org.jbpm.pvm.internal.env
Class BasicEnvironment

java.lang.Object
  extended by org.jbpm.pvm.internal.env.EnvironmentImpl
      extended by org.jbpm.pvm.internal.env.BasicEnvironment
All Implemented Interfaces:
java.io.Serializable, Environment
Direct Known Subclasses:
PvmEnvironment

public class BasicEnvironment
extends EnvironmentImpl

Author:
Tom Baeyens
See Also:
Serialized Form

Field Summary
protected  java.lang.String authenticatedUserId
           
protected  java.lang.ClassLoader classLoader
           
protected  java.util.Map<java.lang.String,Context> contexts
           
protected  java.lang.Throwable exception
           
 
Constructor Summary
BasicEnvironment()
           
 
Method Summary
 void close()
          closes the EnvironmentImpl by removing all its contexts.
<T> T
get(java.lang.Class<T> type)
          searches an object based on type.
<T> T
get(java.lang.Class<T> type, Context requester)
          searches an object based on type in the default search order.
<T> T
get(java.lang.Class<T> type, java.lang.String[] searchOrder)
          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, boolean nullIfNotFound)
           
 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.
 java.lang.Object get(java.lang.String name, java.lang.String[] searchOrder, boolean nullIfNotFound)
           
 java.lang.String getAuthenticatedUserId()
          get the authenticated user id
 java.lang.ClassLoader getClassLoader()
           
 Context getContext(java.lang.String contextName)
           
protected  java.lang.String[] getDefaultSearchOrder()
           
 Context getEnvironmentContext()
           
 Context getEnvironmentFactoryContext()
           
 Context removeContext(Context context)
           
 Context removeContext(java.lang.String contextName)
           
 void setAuthenticatedUserId(java.lang.String authenticatedUserId)
          set the authenticated user id
 void setClassLoader(java.lang.ClassLoader classLoader)
           
 void setContext(Context context)
           
 
Methods inherited from class org.jbpm.pvm.internal.env.EnvironmentImpl
getCurrent, getFromCurrent, getFromCurrent, getFromCurrent, getFromCurrent, popEnvironment, pushEnvironment
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

authenticatedUserId

protected java.lang.String authenticatedUserId

contexts

protected java.util.Map<java.lang.String,Context> contexts

exception

protected java.lang.Throwable exception

classLoader

protected transient java.lang.ClassLoader classLoader
Constructor Detail

BasicEnvironment

public BasicEnvironment()
Method Detail

getContext

public Context getContext(java.lang.String contextName)
Specified by:
getContext in class EnvironmentImpl

setContext

public void setContext(Context context)
Specified by:
setContext in class EnvironmentImpl

removeContext

public Context removeContext(Context context)
Specified by:
removeContext in class EnvironmentImpl

removeContext

public Context removeContext(java.lang.String contextName)
Specified by:
removeContext in class EnvironmentImpl

getEnvironmentFactoryContext

public Context getEnvironmentFactoryContext()

getEnvironmentContext

public Context getEnvironmentContext()

getAuthenticatedUserId

public java.lang.String getAuthenticatedUserId()
Description copied from class: EnvironmentImpl
get the authenticated user id

Specified by:
getAuthenticatedUserId in class EnvironmentImpl

setAuthenticatedUserId

public void setAuthenticatedUserId(java.lang.String authenticatedUserId)
Description copied from class: EnvironmentImpl
set the authenticated user id

Specified by:
setAuthenticatedUserId in class EnvironmentImpl

getClassLoader

public java.lang.ClassLoader getClassLoader()
Specified by:
getClassLoader in class EnvironmentImpl

setClassLoader

public void setClassLoader(java.lang.ClassLoader classLoader)
Specified by:
setClassLoader in class EnvironmentImpl

get

public java.lang.Object get(java.lang.String name)
Description copied from class: EnvironmentImpl
searches a named object in all the contexts in the default search order.

Specified by:
get in interface Environment
Specified by:
get in class EnvironmentImpl
Returns:
the object if it exists in the environment, null if there is no object with the given name in the environment.

get

public java.lang.Object get(java.lang.String name,
                            java.lang.String[] searchOrder)
Description copied from class: EnvironmentImpl
searches a named object in all the contexts in the given search order. The given search order doesn't have to include all contexts. It can be a subset of the contexts available.

Specified by:
get in class EnvironmentImpl
searchOrder - list of contexts names. The object will be searched in these contexts, in the given order.
Returns:
the object if it exists in the environment, null if there is no object with the given name in the specified searchOrder contexts.

get

public java.lang.Object get(java.lang.String name,
                            boolean nullIfNotFound)
Specified by:
get in class EnvironmentImpl

get

public java.lang.Object get(java.lang.String name,
                            java.lang.String[] searchOrder,
                            boolean nullIfNotFound)
Specified by:
get in class EnvironmentImpl

get

public <T> T get(java.lang.Class<T> type)
Description copied from class: EnvironmentImpl
searches an object based on type. The search doesn take superclasses of the context elements into account.

Specified by:
get in interface Environment
Specified by:
get in class EnvironmentImpl
Returns:
the first object of the given type or null in case no such element was found.

get

public <T> T get(java.lang.Class<T> type,
                 java.lang.String[] searchOrder)
Description copied from class: EnvironmentImpl
searches an object based on type. The search doesn take superclasses of the context elements into account.

Specified by:
get in class EnvironmentImpl
Returns:
the first object of the given type or null in case no such element was found.

get

public <T> T get(java.lang.Class<T> type,
                 Context requester)
searches an object based on type in the default search order. if this environment contains the given context, the search skips contexts registered after it.


close

public void close()
Description copied from class: EnvironmentImpl
closes the EnvironmentImpl by removing all its contexts.

Specified by:
close in class EnvironmentImpl

getDefaultSearchOrder

protected java.lang.String[] getDefaultSearchOrder()


Copyright © 2010 JBoss Community. All Rights Reserved.