Class DemoHome
src/main/resources; the demo
writes it there, in its own application module, so the file is visible in the project and every
build carries it into the jar, the Quarkus application and the native image.
The module is found from where the host's own code runs, by Maven's standard layout: the
nearest target directory above it whose parent holds a pom.xml is the module's
build directory, and the module's resources are beside it - from the IDE's target/classes,
a Spring Boot jar, a Quarkus application or a native executable alike, whatever directory the
process was launched from. A process running with no module around it (a jar or an executable
copied to a server) has nowhere to write: it runs on the catalog its build carried, which the
page shows as read-only.
A running process reads the copy its build put on the classpath, so an edit made since would
not reach it; the demo therefore names the file it writes to its own runtime through
nucleo.models, set in code, so what the discovery or the page writes is what this
process runs on, and the next build packages it. A -Dnucleo.models the operator set is
left as it is, and is the file the page edits.
- Since:
- 0.1 (2026-09-25)
- Author:
- Andrey Santrosyan
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidadopt()Names the file to the runtime and adopts it (Models.reload()): the closing step of whatever wrote it - the discovery, or the first edit's materialized defaults.static PathThe file this process writes its catalog to, or null when it runs outside its module and edits nothing.static voidFinds the file the host writes its catalog to - its module'ssrc/main/resources/models.json, or the one the operator named - and, when the file exists, names it to the runtime, which adopts it in the same call (Models.reload()).static PathThe first edit's seat: an edit is a person's action, so it may create the deployment's file - the shipped defaults written into the module'smodels.jsonfor the edit to land in, adopted by the runtime.
-
Method Details
-
configure
Finds the file the host writes its catalog to - its module'ssrc/main/resources/models.json, or the one the operator named - and, when the file exists, names it to the runtime, which adopts it in the same call (Models.reload()). A file that does not exist yet is not created and not named: the file is the deployment's record, so it appears only from a person's action - the discovery writing the account's catalog, or a first edit in the models table (materialize()) - and until then the runtime serves the providers' shipped fragments and says so. Idempotent. Outside a module nothing is named and the runtime keeps the catalog its build carried.- Parameters:
host- a class of the host application, whose location identifies its moduleresource- a resource the host module carries in its ownsrc/main/resources(application.properties,application.yaml), by which the module is found where a class loader hides its class files
-
catalogFile
The file this process writes its catalog to, or null when it runs outside its module and edits nothing. -
adopt
public static void adopt()Names the file to the runtime and adopts it (Models.reload()): the closing step of whatever wrote it - the discovery, or the first edit's materialized defaults. A no-op outside a module, where there is no file to adopt. -
materialize
The first edit's seat: an edit is a person's action, so it may create the deployment's file - the shipped defaults written into the module'smodels.jsonfor the edit to land in, adopted by the runtime. A file already there is the person's, left as it is and adopted. Null outside a module, where an edit has nowhere to land.
-