Package org.multiverse.api
Class GlobalStmInstance
- java.lang.Object
-
- org.multiverse.api.GlobalStmInstance
-
public final class GlobalStmInstance extends java.lang.Object
A singleton that can be used for easy access to theStm
that is used globally. Once it has been set, it should not be changed while running the system.Using the GlobalStmInstance imposes some limitations (like 1 global Stm instance that is used by everything) but makes the system a lot easier to use. But if the GlobalStmInstance should not be used, but a 'private' Stm, you need to carry around the Stm reference yourself and just ignore this GlobalStmInstance.
Initialization
The default implementation is the GammaStm for now. It can be configured through setting the System property: 'org.multiverse.api.GlobalStmInstance.factoryMethod'. This method should be a no arg static method that returns a
Stm
instance.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
DEFAULT_FACTORY_METHOD
private static Stm
instance
private static java.lang.String
KEY
private static java.util.logging.Logger
logger
-
Constructor Summary
Constructors Modifier Constructor Description private
GlobalStmInstance()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Stm
getGlobalStmInstance()
Gets the globalStm
instance.private static java.lang.reflect.Method
getMethod(java.lang.String factoryMethod)
-
-
-
Field Detail
-
KEY
private static final java.lang.String KEY
-
DEFAULT_FACTORY_METHOD
private static final java.lang.String DEFAULT_FACTORY_METHOD
- See Also:
- Constant Field Values
-
logger
private static final java.util.logging.Logger logger
-
instance
private static final Stm instance
-
-