public static class CDIInstanceStoreFactory.CDIInstanceStore extends Object implements InstanceStore
| Constructor and Description |
|---|
CDIInstanceStoreFactory.CDIInstanceStore(Context context,
BeanManager beanManager) |
| Modifier and Type | Method and Description |
|---|---|
Map<String,Object> |
allByAnnotatedWith(Class<? extends Annotation> annotationClass,
Context context)
Return a map of all bean instances annotated with the specified annotation
|
<T> T[] |
allByType(Class<T> type,
Context context,
boolean create)
Return an array of all bean instances implementing the expected type
|
List<String> |
allNames()
Return all bean names set in this container
|
<T> T |
byName(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(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)
|
<T> T |
getNoProxy(String name,
Context context)
Lookup a bean by its name
Does not create a proxy if no bean found
|
void |
remove(String name)
Remove a bean from the container
Not applicable to statically configured containers (Spring/CDI)
|
<T> T |
set(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
|
public CDIInstanceStoreFactory.CDIInstanceStore(Context context, BeanManager beanManager)
public <T> T getNoProxy(String name, Context context)
InstanceStoregetNoProxy in interface InstanceStoreT - bean typename - bean namecontext - context to lookuppublic <T> T byName(String name, Context context)
InstanceStorebyName in interface InstanceStoreT - expected bean typename - bean namecontext - context to lookuppublic <T> T byType(Class<T> type, Context context)
InstanceStorebyType in interface InstanceStoreT - expected bean typetype - expected bean typecontext - context to lookuppublic <T> T[] allByType(Class<T> type, Context context, boolean create)
InstanceStoreallByType in interface InstanceStoreT - expected bean typetype - expected bean typecontext - context to lookupcreate - if true, should create an instance if none is existingpublic Map<String,Object> allByAnnotatedWith(Class<? extends Annotation> annotationClass, Context context)
InstanceStoreallByAnnotatedWith in interface InstanceStoreannotationClass - annotationcontext - context to lookuppublic List<String> allNames()
InstanceStoreallNames in interface InstanceStorepublic <T> T set(String name, T instance)
InstanceStoreset in interface InstanceStoreT - bean typename - bean nameinstance - bean instancepublic <T> T set(T instance)
InstanceStoreset in interface InstanceStoreT - bean typeinstance - bean instancepublic void remove(String name)
InstanceStoreremove in interface InstanceStorename - bean namepublic void clear()
InstanceStoreclear in interface InstanceStore