Class DemoHome

java.lang.Object
ai.redouble.demo.DemoHome

public final class DemoHome extends Object
Where the demo writes its catalog. The runtime reads a catalog off the classpath, the way logback reads its configuration, and an application carries it in 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 Type
    Method
    Description
    static void
    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 Path
    The file this process writes its catalog to, or null when it runs outside its module and edits nothing.
    static void
    configure(Class<?> host, String resource)
    Finds the file the host writes its catalog to - its module's src/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 Path
    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's models.json for the edit to land in, adopted by the runtime.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • configure

      public static void configure(Class<?> host, String resource)
      Finds the file the host writes its catalog to - its module's src/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 module
      resource - a resource the host module carries in its own src/main/resources (application.properties, application.yaml), by which the module is found where a class loader hides its class files
    • catalogFile

      public static Path 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

      public static Path 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's models.json for 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.