public interface InstanceStore
| Modifier and Type | Method and Description |
|---|---|
java.util.Map<java.lang.String,java.lang.Object> |
allByAnnotatedWith(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass,
Context context)
Return a map of all bean instances annotated with the specified annotation
|
<T> T[] |
allByType(java.lang.Class<T> type,
Context context,
boolean create)
Return an array of all bean instances implementing the expected type
|
java.util.List<java.lang.String> |
allNames()
Return all bean names set in this container
|
<T> T |
byName(java.lang.String name,
Context context)
Lookup a bean by its name
The implementation is free to create and return a default instance (such as a service proxy) if no bean exists
|
<T> T |
byType(java.lang.Class<T> type,
Context context)
Lookup a bean by its type
If more than one instance is found, should throw a runtime exception
|
void |
clear()
Clear all beans from the container
Not applicable to statically configured containers (Spring/CDI)
|
boolean |
exists(java.lang.String name)
Indicate if a bean of the specified name exists in the store
|
<T> T |
getNoProxy(java.lang.String name,
Context context)
Lookup a bean by its name
Does not create a proxy if no bean found
|
void |
init() |
void |
inject(java.lang.Object instance,
java.lang.String name,
java.util.Map<java.lang.String,java.lang.Object> properties)
Inject context value into provided instance
|
void |
remove(java.lang.Object instance)
Remove a bean from the container
Not applicable to statically configured containers (Spring/CDI)
|
void |
remove(java.lang.String name)
Remove a bean from the container
Not applicable to statically configured containers (Spring/CDI)
|
<T> T |
set(java.lang.String name,
T instance)
Set a named bean in the container
Not applicable to statically configured containers (Spring/CDI)
|
<T> T |
set(T instance)
Set a bean in the container without specifying a name
Not applicable to statically configured containers (Spring/CDI)
The bean will be accessible only by its type
|
void init()
<T> T set(java.lang.String name,
T instance)
T - bean typename - bean nameinstance - bean instance<T> T set(T instance)
T - bean typeinstance - bean instancevoid remove(java.lang.String name)
name - bean namevoid remove(java.lang.Object instance)
instance - bean instancevoid inject(java.lang.Object instance,
java.lang.String name,
java.util.Map<java.lang.String,java.lang.Object> properties)
instance - instance to inject intoname - component nameproperties - properties defined on the contextvoid clear()
java.util.List<java.lang.String> allNames()
boolean exists(java.lang.String name)
name - component name<T> T byName(java.lang.String name,
Context context)
T - expected bean typename - bean namecontext - context to lookup<T> T getNoProxy(java.lang.String name,
Context context)
T - bean typename - bean namecontext - context to lookup<T> T byType(java.lang.Class<T> type,
Context context)
T - expected bean typetype - expected bean typecontext - context to lookup<T> T[] allByType(java.lang.Class<T> type,
Context context,
boolean create)
T - expected bean typetype - expected bean typecontext - context to lookupcreate - if true, should create an instance if none is existingjava.util.Map<java.lang.String,java.lang.Object> allByAnnotatedWith(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass,
Context context)
annotationClass - annotationcontext - context to lookup