org.apache.openejb.loader
Class SystemInstance
java.lang.Object
org.apache.openejb.loader.SystemInstance
public class SystemInstance
- extends Object
This class aims to be the one and only static in the entire system
A static, singleton, instance of this class can be created with the 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.
- Version:
- $Revision: 570634 $ $Date: 2007-08-29 06:31:49 +0200 (Mi, 29. Aug 2007) $
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
getStartTime
public long getStartTime()
getProperties
public Properties getProperties()
getProperty
public String getProperty(String key)
getProperty
public String getProperty(String key,
String defaultValue)
setProperty
public Object setProperty(String key,
String value)
setProperty
public Object setProperty(String key,
String value,
boolean isExternalProperty)
- Parameters:
key
- property namevalue
- property valueisExternalProperty
- should the property be set to System by System.setProperty(String, String)
- Returns:
- property value
getHome
public FileUtils getHome()
getBase
public FileUtils getBase()
getClassPath
public ClassPath getClassPath()
getClassLoader
public ClassLoader getClassLoader()
getComponent
public <T> T getComponent(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. Theoretically, you can't lookup things that you can't already see
in your classloader.
- Parameters:
type
-
- Returns:
- the object associated with the class type or null
- Throws:
IllegalStateException
- of the component isn't found
removeComponent
public <T> T removeComponent(Class<T> type)
setComponent
public <T> T setComponent(Class<T> type,
T value)
- Parameters:
type
- the class type of the component required
isInitialized
public static boolean isInitialized()
init
public static void init(Properties properties)
throws Exception
- Throws:
Exception
get
public static SystemInstance get()
hasProperty
public boolean hasProperty(String propName)
- Parameters:
propName
- property name
- Returns:
- true when property is set; false otherwise
Copyright © 1999-2011 The Apache OpenEJB development community. All Rights Reserved.