public class BlueprintRepository extends Object implements Repository, ExecutionContext
ExecutionContext.Holder
Constructor and Description |
---|
BlueprintRepository(ExtendedBlueprintContainer container) |
Modifier and Type | Method and Description |
---|---|
void |
addFullObject(String name,
Object object) |
void |
addPartialObject(String name,
Object object) |
boolean |
canConvert(Object value,
ReifiedType type) |
boolean |
containsObject(String name)
Does this context contain a object with the specified name.
|
Object |
convert(Object value,
ReifiedType type) |
Object |
create(String name) |
Map<String,Object> |
createAll(Collection<String> names) |
void |
destroy() |
<T> List<T> |
getAllRecipes(Class<T> clazz,
String... names) |
Set<Recipe> |
getAllRecipes(String... names) |
Object |
getInstance(String name)
Return the singleton instance for the given name.
|
Object |
getInstanceLock()
Lock that should be used to synchronized creation of singletons
|
Set<String> |
getNames()
Returns the set of all known object names (recipes, instances or default objects)
|
Object |
getObject(String name)
Gets the object or recipe with the specified name from the repository.
|
Object |
getPartialObject(String name) |
Recipe |
getRecipe(String name)
Return the recipe for the given name.
|
LinkedList<Recipe> |
getStack() |
Class |
loadClass(String typeName) |
Recipe |
pop()
Removes the top recipe from the execution stack.
|
void |
push(Recipe recipe)
Adds a recipe to the top of the execution stack.
|
void |
putRecipe(String name,
Recipe recipe) |
Object |
removePartialObject(String name) |
void |
removeRecipe(String name)
Remove an uninstantiated recipe
|
void |
validate() |
public BlueprintRepository(ExtendedBlueprintContainer container)
public Object getInstance(String name)
Repository
getInstance
in interface Repository
null
public Recipe getRecipe(String name)
Repository
getRecipe
in interface ExecutionContext
getRecipe
in interface Repository
null
public Set<String> getNames()
Repository
getNames
in interface Repository
public void putRecipe(String name, Recipe recipe)
putRecipe
in interface Repository
public void removeRecipe(String name)
Repository
removeRecipe
in interface Repository
public Object create(String name) throws ComponentDefinitionException
create
in interface Repository
ComponentDefinitionException
public Map<String,Object> createAll(Collection<String> names) throws ComponentDefinitionException
createAll
in interface Repository
ComponentDefinitionException
public <T> List<T> getAllRecipes(Class<T> clazz, String... names)
getAllRecipes
in interface Repository
public Set<Recipe> getAllRecipes(String... names)
getAllRecipes
in interface Repository
public void validate()
public void destroy()
destroy
in interface Repository
public Object getInstanceLock()
Repository
getInstanceLock
in interface ExecutionContext
getInstanceLock
in interface Repository
public void push(Recipe recipe)
ExecutionContext
push
in interface ExecutionContext
recipe
- the recipe to add to the stackpublic Recipe pop()
ExecutionContext
pop
in interface ExecutionContext
public LinkedList<Recipe> getStack()
public boolean containsObject(String name)
ExecutionContext
containsObject
in interface ExecutionContext
name
- the unique name of the object instancepublic Object getObject(String name)
ExecutionContext
getObject
in interface ExecutionContext
name
- the unique name of the object instancepublic void addFullObject(String name, Object object)
addFullObject
in interface ExecutionContext
public void addPartialObject(String name, Object object)
addPartialObject
in interface ExecutionContext
public Object removePartialObject(String name)
removePartialObject
in interface ExecutionContext
public Object getPartialObject(String name)
getPartialObject
in interface ExecutionContext
public Object convert(Object value, ReifiedType type) throws Exception
convert
in interface ExecutionContext
Exception
public boolean canConvert(Object value, ReifiedType type)
canConvert
in interface ExecutionContext
public Class loadClass(String typeName) throws ClassNotFoundException
loadClass
in interface ExecutionContext
ClassNotFoundException
Copyright © 2012. All Rights Reserved.