Affects Version/s: Jena 3.0.0
Fix Version/s: Jena 3.0.1
A subsystem lifecyclefor Jena would provide the hook for:
- basic wiring together e.g. wiring RIOT into Jena core
- initialization e.g. TDB.init() becomes redundant
- starting and stopping in large systems, e.g. starting and stopping Fuseki2 when in a Tomcat server
This proposal is as simple as possible. It is for system bootstrap and basic lifecycle. It is not intended to work for a mixture of jars from different Jena releases.
stop would not be called normally as part of JVM exit (code can do that itself anyway). It is in support of start-stop-(re)start and only called if there is a hook for such a cycle. stop is more of a placeholder for the moment.
There is a single registry:
Jena core provides a "system init" that is cheap to call if initialization has already occurred. It should attempt the first call as early as possible.
When initializing, it runs a ServiceLoader cycle to discover any JenaSubsystemLifecycle implementations described in a META-INF/services/... file and populates the registry. Then the registry is
used to call start() in some unspecified order.