Package org.apache.xbean.recipe
Class DefaultExecutionContext
java.lang.Object
org.apache.xbean.recipe.ExecutionContext
org.apache.xbean.recipe.DefaultExecutionContext
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add an object to the repository.void
addReference
(Reference reference) Adds a reference to an object to this context.boolean
containsObject
(String name) Does this context contain a object with the specified name.Gets the class loader used for loading of all classes during the life of this execution contextGets the object or recipe with the specified name from the repository.getStack()
Gets a snapshot of the current execution stack.Gets the unresolved references by name.pop()
Removes the top recipe from the execution stack.void
Adds a recipe to the top of the execution stack.void
setRepository
(Repository repository) Methods inherited from class org.apache.xbean.recipe.ExecutionContext
getContext, isContextSet, setContext
-
Constructor Details
-
DefaultExecutionContext
public DefaultExecutionContext() -
DefaultExecutionContext
-
-
Method Details
-
push
Description copied from class:ExecutionContext
Adds a recipe to the top of the execution stack. If the recipe is already on the stack, a CircularDependencyException is thrown.- Specified by:
push
in classExecutionContext
- Parameters:
recipe
- the recipe to add to the stack
-
pop
Description copied from class:ExecutionContext
Removes the top recipe from the execution stack.- Specified by:
pop
in classExecutionContext
- Returns:
- the top recipe on the stack
-
getStack
Description copied from class:ExecutionContext
Gets a snapshot of the current execution stack. The returned list is a snapshot so any modification of the returned list does not modify the stack contained in this object.- Specified by:
getStack
in classExecutionContext
- Returns:
- a snapshot of the current execution stack
-
getRepository
-
setRepository
-
containsObject
Description copied from class:ExecutionContext
Does this context contain a object with the specified name.- Specified by:
containsObject
in classExecutionContext
- Parameters:
name
- the unique name of the object instance- Returns:
- true if this context contain a object with the specified name
-
getObject
Description copied from class:ExecutionContext
Gets the object or recipe with the specified name from the repository.- Specified by:
getObject
in classExecutionContext
- Parameters:
name
- the unique name of the object instance- Returns:
- the object instance, a recipe to build the object or null
-
addObject
Description copied from class:ExecutionContext
Add an object to the repository.- Specified by:
addObject
in classExecutionContext
- Parameters:
name
- the unique name of the object instanceobject
- the object instance
-
addReference
Description copied from class:ExecutionContext
Adds a reference to an object to this context. If an object is already registered under the referenced name, the reference will immedately be set. Otherwise, the reference will be set when an object is added with the referenced name.- Specified by:
addReference
in classExecutionContext
- Parameters:
reference
- the reference to set
-
getUnresolvedRefs
Description copied from class:ExecutionContext
Gets the unresolved references by name.- Specified by:
getUnresolvedRefs
in classExecutionContext
- Returns:
- the unresolved references by name
-
getClassLoader
Description copied from class:ExecutionContext
Gets the class loader used for loading of all classes during the life of this execution context- Specified by:
getClassLoader
in classExecutionContext
- Returns:
- the class loader for loading classes in this context
-