public final class SystemInstance
extends java.lang.Object
init(Properties)
method
It is assumed that only one singleton per classloader is possible in any given VM
Thus loading this instance in a classloader will mean there can only be one OpenEJB
instance for that classloader and all children classloaders.Modifier and Type | Method and Description |
---|---|
boolean |
addObserver(java.lang.Object observer) |
java.lang.String |
currentProfile() |
<E> E |
fireEvent(E event) |
static SystemInstance |
get() |
FileUtils |
getBase() |
java.lang.ClassLoader |
getClassLoader() |
ClassPath |
getClassPath() |
<T> T |
getComponent(java.lang.Class<T> type)
I'm not sure how this will play out, but I've used class instances instead of strings
for lookups as class instances are classloader scoped and there is an implicit "namespace"
associated with that.
|
java.io.File |
getConf(java.lang.String subPath) |
FileUtils |
getHome() |
Options |
getOptions() |
java.util.Properties |
getProperties() |
java.lang.String |
getProperty(java.lang.String key) |
java.lang.String |
getProperty(java.lang.String key,
java.lang.String defaultValue) |
long |
getStartTime() |
boolean |
hasProperty(java.lang.String propName) |
static void |
init(java.util.Properties properties) |
boolean |
isDefaultProfile() |
static boolean |
isInitialized() |
<T> T |
removeComponent(java.lang.Class<T> type) |
boolean |
removeObserver(java.lang.Object observer) |
void |
removeObservers() |
static void |
reset() |
<T> T |
setComponent(java.lang.Class<T> type,
T value) |
java.lang.Object |
setProperty(java.lang.String key,
java.lang.String value) |
java.lang.Object |
setProperty(java.lang.String key,
java.lang.String value,
boolean isExternalProperty) |
public <E> E fireEvent(E event)
public boolean addObserver(java.lang.Object observer)
public boolean removeObserver(java.lang.Object observer)
public long getStartTime()
public Options getOptions()
public java.util.Properties getProperties()
public java.lang.String getProperty(java.lang.String key)
public java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
public java.lang.Object setProperty(java.lang.String key, java.lang.String value)
public java.lang.Object setProperty(java.lang.String key, java.lang.String value, boolean isExternalProperty)
key
- property namevalue
- property valueisExternalProperty
- should the property be set to System by System.setProperty(String, String)
public FileUtils getHome()
public FileUtils getBase()
public ClassPath getClassPath()
public java.lang.ClassLoader getClassLoader()
public <T> T getComponent(java.lang.Class<T> type)
type
- Classjava.lang.IllegalStateException
- of the component isn't foundpublic <T> T removeComponent(java.lang.Class<T> type)
public <T> T setComponent(java.lang.Class<T> type, T value)
type
- the class type of the component requiredpublic static boolean isInitialized()
public static void reset()
public static void init(java.util.Properties properties) throws java.lang.Exception
java.lang.Exception
public java.io.File getConf(java.lang.String subPath)
public static SystemInstance get()
public java.lang.String currentProfile()
public boolean isDefaultProfile()
public boolean hasProperty(java.lang.String propName)
propName
- property namepublic void removeObservers()