Package org.apache.xbean.recipe
Class ObjectGraph.WrapperExecutionContext
- java.lang.Object
-
- org.apache.xbean.recipe.ExecutionContext
-
- org.apache.xbean.recipe.ObjectGraph.WrapperExecutionContext
-
- Enclosing class:
- ObjectGraph
private static class ObjectGraph.WrapperExecutionContext extends ExecutionContext
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,java.lang.Object>constructedObjectprivate ExecutionContextexecutionContext
-
Constructor Summary
Constructors Modifier Constructor Description privateWrapperExecutionContext(ExecutionContext executionContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddObject(java.lang.String name, java.lang.Object object)Add an object to the repository.voidaddReference(Reference reference)Adds a reference to an object to this context.booleancontainsObject(java.lang.String name)Does this context contain a object with the specified name.java.lang.ClassLoadergetClassLoader()Gets the class loader used for loading of all classes during the life of this execution contextjava.util.Map<java.lang.String,java.lang.Object>getConstructedObject()java.lang.ObjectgetObject(java.lang.String name)Gets the object or recipe with the specified name from the repository.java.util.LinkedList<Recipe>getStack()Gets a snapshot of the current execution stack.java.util.Map<java.lang.String,java.util.List<Reference>>getUnresolvedRefs()Gets the unresolved references by name.Recipepop()Removes the top recipe from the execution stack.voidpush(Recipe recipe)Adds a recipe to the top of the execution stack.-
Methods inherited from class org.apache.xbean.recipe.ExecutionContext
getContext, isContextSet, setContext
-
-
-
-
Field Detail
-
executionContext
private final ExecutionContext executionContext
-
constructedObject
private final java.util.Map<java.lang.String,java.lang.Object> constructedObject
-
-
Constructor Detail
-
WrapperExecutionContext
private WrapperExecutionContext(ExecutionContext executionContext)
-
-
Method Detail
-
getConstructedObject
public java.util.Map<java.lang.String,java.lang.Object> getConstructedObject()
-
push
public void push(Recipe recipe) throws CircularDependencyException
Description copied from class:ExecutionContextAdds a recipe to the top of the execution stack. If the recipe is already on the stack, a CircularDependencyException is thrown.- Specified by:
pushin classExecutionContext- Parameters:
recipe- the recipe to add to the stack- Throws:
CircularDependencyException- if the recipe is already on the stack
-
pop
public Recipe pop()
Description copied from class:ExecutionContextRemoves the top recipe from the execution stack.- Specified by:
popin classExecutionContext- Returns:
- the top recipe on the stack
-
getStack
public java.util.LinkedList<Recipe> getStack()
Description copied from class:ExecutionContextGets 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:
getStackin classExecutionContext- Returns:
- a snapshot of the current execution stack
-
getObject
public java.lang.Object getObject(java.lang.String name)
Description copied from class:ExecutionContextGets the object or recipe with the specified name from the repository.- Specified by:
getObjectin classExecutionContext- Parameters:
name- the unique name of the object instance- Returns:
- the object instance, a recipe to build the object or null
-
containsObject
public boolean containsObject(java.lang.String name)
Description copied from class:ExecutionContextDoes this context contain a object with the specified name.- Specified by:
containsObjectin classExecutionContext- Parameters:
name- the unique name of the object instance- Returns:
- true if this context contain a object with the specified name
-
addObject
public void addObject(java.lang.String name, java.lang.Object object)Description copied from class:ExecutionContextAdd an object to the repository.- Specified by:
addObjectin classExecutionContext- Parameters:
name- the unique name of the object instanceobject- the object instance
-
addReference
public void addReference(Reference reference)
Description copied from class:ExecutionContextAdds 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:
addReferencein classExecutionContext- Parameters:
reference- the reference to set
-
getUnresolvedRefs
public java.util.Map<java.lang.String,java.util.List<Reference>> getUnresolvedRefs()
Description copied from class:ExecutionContextGets the unresolved references by name.- Specified by:
getUnresolvedRefsin classExecutionContext- Returns:
- the unresolved references by name
-
getClassLoader
public java.lang.ClassLoader getClassLoader()
Description copied from class:ExecutionContextGets the class loader used for loading of all classes during the life of this execution context- Specified by:
getClassLoaderin classExecutionContext- Returns:
- the class loader for loading classes in this context
-
-