vidocq-runtime-core is the Vidocq Runtime runtime engine. It discovers the extensions through ServiceLoader, builds the configuration, boots the Vauban CDI container and drives the extension lifecycle.
Coordinates
Artefact |
|
Java module |
|
Source |
|
Responsibilities
-
Discover every
VidocqExtensionon the module path viajava.util.ServiceLoader(ExtensionLoader), sorted by ascendingpriority(). -
Build the configuration (
VidocqConfigImplover the built-inConfigSourcechain, wrapped by the legacyVidocqConfigurationImpl). -
Run the lifecycle in order (
VidocqBootstrap):-
configure — each extension reads its keys:
ext.configure(configuration). -
beforeStart — create the
VaubanContainerBuilder(bean index fromMETA-INF/vauban-beans.list, no classpath scanning) and let each extension enrich it:ext.beforeStart(builder). -
CDI start —
builder.build()boots Vauban. -
onStart — each extension receives the
ExtensionContext(container, bean manager, config): the Chappe extension opens the HTTP listeners, Cassini mounts the REST routes, Mansart opens the JDBC pool.
-
-
Warn about configured
vidocq.*keys no extension consumes (ConfigKeyAudit, based onVidocqExtension.configKeys()). -
Manage the shutdown cycle —
onStop()runs in reverse priority order, virtual threads drain cleanly. -
Install the Vauban application layer when the launch vehicle requires it (
VidocqAppLayer,Vidocq.run), including thevidocq:devhot-reload loop (VidocqDevReloadLoop).
Entry point
package io.example;
public class App {
public static void main(String[] args) {
io.vidocq.runtime.core.Vidocq.main(args);
}
}
Vidocq.main is a simple facade over VidocqBootstrap. User code does not need a @SpringBootApplication nor an application class — extensions and beans are discovered from the module path (ServiceLoader + the compile-time bean index). For a zero-config IDE launch, annotate a trampoline main with @VidocqMain and call Vidocq.run(App.class, args) — the application is then re-loaded inside the Vauban application layer.
Lifecycle hooks
An extension subscribes to phases by overriding the VidocqExtension methods:
public class MyExtension implements VidocqExtension {
@Override
public String name() { return "my-extension"; }
@Override
public void onStart(ExtensionContext ctx) {
// the container is up — resolve beans, mount handlers
}
@Override
public void onStop() {
// reverse-order shutdown — release resources
}
}
All hooks have empty default implementations; priority() (default 1000, lower runs first) orders the extensions within every phase.