org.apache.openejb.loader
Class SystemInstance
java.lang.Object
org.apache.openejb.loader.SystemInstance
public class SystemInstance
- extends java.lang.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: 752255 $ $Date: 2009-03-10 21:45:35 +0100 (Di, 10. Mär 2009) $
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
getStartTime
public long getStartTime()
getOptions
public Options getOptions()
getProperties
public java.util.Properties getProperties()
getProperty
public java.lang.String getProperty(java.lang.String key)
getProperty
public java.lang.String getProperty(java.lang.String key,
java.lang.String defaultValue)
setProperty
public java.lang.Object setProperty(java.lang.String key,
java.lang.String value)
setProperty
public java.lang.Object setProperty(java.lang.String key,
java.lang.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 java.lang.ClassLoader getClassLoader()
getComponent
public <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. 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:
java.lang.IllegalStateException
- of the component isn't found
removeComponent
public <T> T removeComponent(java.lang.Class<T> type)
setComponent
public <T> T setComponent(java.lang.Class<T> type,
T value)
- Parameters:
type
- the class type of the component required
isInitialized
public static boolean isInitialized()
reset
public static void reset()
init
public static void init(java.util.Properties properties)
throws java.lang.Exception
- Throws:
java.lang.Exception
get
public static SystemInstance get()
hasProperty
public boolean hasProperty(java.lang.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.