Class DesktopEnvironmentPostProcessor
- All Implemented Interfaces:
org.springframework.boot.env.EnvironmentPostProcessor,org.springframework.core.Ordered
--onec.desktop.home=<dir>
pointing at the OS per-user app-data directory. In that case we relocate an
embedded H2 file datasource under <home>/data so the database
lives with the user's data rather than next to the binary (which, for a bundled
desktop app, is read-only and ephemeral).
Runs as an EnvironmentPostProcessor because the rewrite must land
before spring.datasource.url is bound. When onec.desktop.home
is unset — normal bootRun/server runs — this does nothing, so dev is
untouched. Bold by design: in desktop mode the relocation is unconditional, no
opt-in flag.
It also keeps the user logged in across launches. Every launch starts a fresh JVM, so an in-memory HTTP session dies each time and the user would re-login. In desktop mode we persist sessions in the (now file-backed) datasource via Spring Session JDBC and hand the webview a long-lived, persistent cookie — so "stay logged in" behaves like a native app. The session defaults go in at lowest precedence, so an app can still override the timeout or cookie.
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetOrder()voidpostProcessEnvironment(org.springframework.core.env.ConfigurableEnvironment environment, org.springframework.boot.SpringApplication application)
-
Constructor Details
-
DesktopEnvironmentPostProcessor
public DesktopEnvironmentPostProcessor()
-
-
Method Details
-
postProcessEnvironment
public void postProcessEnvironment(org.springframework.core.env.ConfigurableEnvironment environment, org.springframework.boot.SpringApplication application) - Specified by:
postProcessEnvironmentin interfaceorg.springframework.boot.env.EnvironmentPostProcessor
-
getOrder
public int getOrder()- Specified by:
getOrderin interfaceorg.springframework.core.Ordered
-