|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jbpm.env.Environment org.jbpm.env.impl.DefaultEnvironment
public class DefaultEnvironment
Field Summary | |
---|---|
protected java.lang.ClassLoader |
classLoader
|
static java.lang.String |
CONTEXTNAME_APPLICATION
key of the application context in the environment |
static java.lang.String |
CONTEXTNAME_BLOCK
key of the block context in the environment |
protected java.util.Map<java.lang.String,Context> |
contexts
|
protected DefaultEnvironmentFactory |
defaultEnvironmentFactory
|
protected java.lang.String[] |
defaultSearchOrder
|
protected java.util.ArrayList<java.lang.String> |
defaultSearchOrderList
|
static java.lang.String |
EVENT_CLOSEENVIRONMENT
is fired when a environment created by this factory is being closed. |
static java.lang.String |
EVENT_EXCEPTION
is fired for each exception reported in an environment block with Environment.setException(Throwable) . |
static java.lang.String |
EVENT_OPENENVIRONMENT
is fired when a new environment is being opened with this environment factory. |
protected java.lang.Throwable |
exception
|
protected java.lang.String |
userId
|
Constructor Summary | |
---|---|
DefaultEnvironment(DefaultEnvironmentFactory defaultEnvironmentFactory)
|
Method Summary | ||
---|---|---|
void |
addContext(Context context)
|
|
void |
close()
closes the Environment by removing all its contexts. |
|
|
find(java.lang.Class<T> type,
java.lang.String[] searchOrder)
|
|
|
get(java.lang.Class<T> type)
searches an object based on type. |
|
java.lang.Object |
get(java.lang.String name)
searches a named object in all the contexts in the default search order. |
|
java.lang.Object |
get(java.lang.String name,
java.lang.String[] searchOrder)
searches a named object in all the contexts in the given search order. |
|
Context |
getApplicationContext()
|
|
Context |
getBlockContext()
|
|
java.lang.ClassLoader |
getClassLoader()
|
|
Context |
getContext(java.lang.String contextName)
|
|
EnvironmentFactory |
getEnvironmentFactory()
|
|
java.lang.Throwable |
getException()
retrieves the first exception that was reported in this environment block. |
|
Transaction |
getTransaction()
convenience method for finding the Transaction . |
|
java.lang.String |
getUserId()
get the authenticated user id |
|
void |
removeContext(java.lang.String contextName)
|
|
protected static void |
rethrow(java.lang.Throwable exception)
|
|
void |
setClassLoader(java.lang.ClassLoader classLoader)
|
|
void |
setException(java.lang.Throwable exception)
for clients to indicate that an exception has occurred in this environment block. |
|
void |
setUserId(java.lang.String userId)
set the authenticated user id |
|
java.lang.String |
toString()
|
Methods inherited from class org.jbpm.env.Environment |
---|
getCurrent, pop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CONTEXTNAME_APPLICATION
public static final java.lang.String CONTEXTNAME_BLOCK
public static final java.lang.String EVENT_EXCEPTION
Environment.setException(Throwable)
.
public static final java.lang.String EVENT_CLOSEENVIRONMENT
public static final java.lang.String EVENT_OPENENVIRONMENT
protected java.lang.String userId
protected DefaultEnvironmentFactory defaultEnvironmentFactory
protected java.util.Map<java.lang.String,Context> contexts
protected java.util.ArrayList<java.lang.String> defaultSearchOrderList
protected java.lang.String[] defaultSearchOrder
protected transient java.lang.ClassLoader classLoader
protected java.lang.Throwable exception
Constructor Detail |
---|
public DefaultEnvironment(DefaultEnvironmentFactory defaultEnvironmentFactory)
Method Detail |
---|
public Context getContext(java.lang.String contextName)
getContext
in class Environment
public void addContext(Context context)
addContext
in class Environment
public void removeContext(java.lang.String contextName)
removeContext
in class Environment
public Context getApplicationContext()
public Context getBlockContext()
public EnvironmentFactory getEnvironmentFactory()
getEnvironmentFactory
in class Environment
public java.lang.String getUserId()
Environment
getUserId
in class Environment
public void setUserId(java.lang.String userId)
Environment
setUserId
in class Environment
public java.lang.ClassLoader getClassLoader()
getClassLoader
in class Environment
public void setClassLoader(java.lang.ClassLoader classLoader)
setClassLoader
in class Environment
public java.lang.Object get(java.lang.String name)
Environment
get
in class Environment
null
if there is no object with the given name in the environment.public java.lang.Object get(java.lang.String name, java.lang.String[] searchOrder)
Environment
get
in class Environment
searchOrder
- list of contexts names. The object will be searched in these contexts, in the given order.
null
if there is no object with the given name in the specified searchOrder contexts.public <T> T get(java.lang.Class<T> type)
Environment
get
in class Environment
WireContext.get(Class)
public <T> T find(java.lang.Class<T> type, java.lang.String[] searchOrder)
public Transaction getTransaction()
Environment
Transaction
.
getTransaction
in class Environment
public void setException(java.lang.Throwable exception)
Environment
setException
in class Environment
public java.lang.Throwable getException()
Environment
getException
in class Environment
public void close()
Environment
Context.setEnvironment(Environment)
will be called with a
null value for environment.
close
in class Environment
public java.lang.String toString()
toString
in class java.lang.Object
protected static void rethrow(java.lang.Throwable exception) throws java.lang.Error
java.lang.Error
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |