public class BlueprintRepository extends Object implements Repository, ExecutionContext
ExecutionContext.Holder
Constructor and Description |
---|
BlueprintRepository(ExtendedBlueprintContainer container) |
Modifier and Type | Method and Description |
---|---|
Future<Object> |
addFullObject(String name,
Future<Object> object)
Try to add a full object and return the already registered future if available
|
void |
addPartialObject(String name,
Object object) |
boolean |
canConvert(Object value,
org.osgi.service.blueprint.container.ReifiedType type) |
boolean |
containsObject(String name)
Does this context contain a object with the specified name.
|
Object |
convert(Object value,
org.osgi.service.blueprint.container.ReifiedType type) |
Object |
create(String name) |
Object |
create(String name,
Collection<Class<?>> proxyInterfaces) |
void |
createAll(Collection<String> names) |
Map<String,Object> |
createAll(Collection<String> names,
Collection<Class<?>> proxyInterfaces) |
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.
|
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.
|
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) |
void |
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 org.osgi.service.blueprint.container.ComponentDefinitionException
create
in interface Repository
org.osgi.service.blueprint.container.ComponentDefinitionException
public Object create(String name, Collection<Class<?>> proxyInterfaces) throws org.osgi.service.blueprint.container.ComponentDefinitionException
create
in interface Repository
org.osgi.service.blueprint.container.ComponentDefinitionException
public Map<String,Object> createAll(Collection<String> names, Collection<Class<?>> proxyInterfaces) throws org.osgi.service.blueprint.container.ComponentDefinitionException
createAll
in interface Repository
org.osgi.service.blueprint.container.ComponentDefinitionException
public void createAll(Collection<String> names) throws org.osgi.service.blueprint.container.ComponentDefinitionException
createAll
in interface Repository
org.osgi.service.blueprint.container.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 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 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 Future<Object> addFullObject(String name, Future<Object> object)
ExecutionContext
addFullObject
in interface ExecutionContext
public void addPartialObject(String name, Object object)
addPartialObject
in interface ExecutionContext
public Object getPartialObject(String name)
getPartialObject
in interface ExecutionContext
public void removePartialObject(String name)
removePartialObject
in interface ExecutionContext
public Object convert(Object value, org.osgi.service.blueprint.container.ReifiedType type) throws Exception
convert
in interface ExecutionContext
Exception
public boolean canConvert(Object value, org.osgi.service.blueprint.container.ReifiedType type)
canConvert
in interface ExecutionContext
public Class loadClass(String typeName) throws ClassNotFoundException
loadClass
in interface ExecutionContext
ClassNotFoundException
Copyright © 2017. All rights reserved.