Class ExecutionContext
java.lang.Object
org.apache.xbean.recipe.ExecutionContext
- Direct Known Subclasses:
DefaultExecutionContext
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidAdd an object to the repository.abstract voidaddReference(Reference reference) Adds a reference to an object to this context.abstract booleancontainsObject(String name) Does this context contain a object with the specified name.abstract ClassLoaderGets the class loader used for loading of all classes during the life of this execution contextstatic ExecutionContextabstract ObjectGets the object or recipe with the specified name from the repository.abstract LinkedList<Recipe> getStack()Gets a snapshot of the current execution stack.Gets the unresolved references by name.static booleanabstract Recipepop()Removes the top recipe from the execution stack.abstract voidAdds a recipe to the top of the execution stack.static ExecutionContextsetContext(ExecutionContext newContext)
-
Constructor Details
-
ExecutionContext
public ExecutionContext()
-
-
Method Details
-
isContextSet
-
getContext
-
setContext
-
push
Adds a recipe to the top of the execution stack. If the recipe is already on the stack, a CircularDependencyException is thrown.- Parameters:
recipe- the recipe to add to the stack- Throws:
CircularDependencyException- if the recipe is already on the stack
-
pop
-
getStack
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.- Returns:
- a snapshot of the current execution stack
-
containsObject
Does this context contain a object with the specified name.- Parameters:
name- the unique name of the object instance- Returns:
- true if this context contain a object with the specified name
-
getObject
-
addObject
Add an object to the repository.- Parameters:
name- the unique name of the object instanceobject- the object instance- Throws:
ConstructionException- if another object instance is already registered with the name
-
addReference
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.- Parameters:
reference- the reference to set
-
getUnresolvedRefs
Gets the unresolved references by name.- Returns:
- the unresolved references by name
-
getClassLoader
Gets the class loader used for loading of all classes during the life of this execution context- Returns:
- the class loader for loading classes in this context
-