public class JenaSystem extends Object
All initialization should be concurrent and thread-safe. In particular, some subsystems need initialization in some sort of order (e.g. ARQ before TDB).
This is achieved by "levels": levels less than 100 are considered "jena system levels" and are reserved.
Modifier and Type | Field and Description |
---|---|
static boolean |
DEBUG_INIT
Development support - flag to enable output during
initialization.
|
Constructor and Description |
---|
JenaSystem() |
Modifier and Type | Method and Description |
---|---|
static void |
forEach(Consumer<JenaSubsystemLifecycle> action)
Call an action on each item in the registry.
|
static void |
forEachReverse(Consumer<JenaSubsystemLifecycle> action)
Call an action on each item in the registry but in the reverse
enumeration order.
|
static JenaSubsystemRegistry |
get()
The current JenaSubsystemRegistry
|
static void |
init()
Initialize Jena.
|
static void |
logLifecycle(String fmt,
Object... args)
Output a debugging message if DEBUG_INIT is set
|
static void |
setSubsystemRegistry(JenaSubsystemRegistry thing)
Set the
JenaSubsystemRegistry . |
static void |
shutdown()
Shutdown subsystems
|
public static boolean DEBUG_INIT
System.err
, not a logger
to avoid the risk of recursive initialization.public static void init()
This function is cheap to call when already initialized so can be called to be sure. A commonly used idiom in jena is a static initializer in key classes.
By default, initialization happens by using ServiceLoader.load
to find
JenaSubsystemLifecycle
objects.
See setSubsystemRegistry(org.apache.jena.system.JenaSubsystemRegistry)
to intercept that choice.
public static void shutdown()
public static void setSubsystemRegistry(JenaSubsystemRegistry thing)
JenaSubsystemRegistry
.
To have any effect, this function
must be called before any other Jena code,
and especially before calling JenaSystem.init()
.public static JenaSubsystemRegistry get()
public static void forEach(Consumer<JenaSubsystemLifecycle> action)
action
- public static void forEachReverse(Consumer<JenaSubsystemLifecycle> action)
forEach(java.util.function.Consumer<org.apache.jena.system.JenaSubsystemLifecycle>)
, which may not
be stable within a level. It is not related to registration order.action
- Licenced under the Apache License, Version 2.0