|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.webbeans.ManagerImpl
@Standard public class ManagerImpl
Implementation of the Web Beans Manager. Essentially a singleton for registering Beans, Contexts, Observers, Interceptors etc. as well as providing resolution
| Field Summary | |
|---|---|
static java.lang.String |
JNDI_KEY
|
| Constructor Summary | |
|---|---|
ManagerImpl()
Constructor |
|
| Method Summary | ||
|---|---|---|
Manager |
addBean(Bean<?> bean)
Registers a bean with the manager |
|
Manager |
addContext(Context context)
Registers a context with the manager |
|
Manager |
addDecorator(Decorator decorator)
Registers a decorator with the manager |
|
Manager |
addInterceptor(Interceptor interceptor)
Registers an interceptor with the manager |
|
|
addObserver(Observer<T> observer,
java.lang.Class<T> eventType,
java.lang.annotation.Annotation... bindings)
Registers an observer for a given event type and binding types |
|
|
addObserver(Observer<T> observer,
TypeLiteral<T> eventType,
java.lang.annotation.Annotation... bindings)
Registers an observer for a given event type literal and binding types |
|
protected void |
checkEnabledDeploymentTypes()
Set up the enabled deployment types, if none are specified by the user, the default @Production and @Standard are used. |
|
Manager |
createChildManager()
|
|
void |
fireEvent(java.lang.Object event,
java.lang.annotation.Annotation... bindings)
Fires an event object with given event object for given bindings |
|
java.util.Map<java.lang.Class<?>,Bean<?>> |
getBeanMap()
|
|
java.util.List<Bean<?>> |
getBeans()
The beans registered with the Web Bean manager. |
|
Context |
getBuiltInContext(java.lang.Class<? extends java.lang.annotation.Annotation> scopeType)
Direct access to built in contexts. |
|
Context |
getContext(java.lang.Class<? extends java.lang.annotation.Annotation> scopeType)
Gets an active context of the given scope. |
|
EjbDescriptorCache |
getEjbDescriptorCache()
|
|
java.util.List<java.lang.Class<? extends java.lang.annotation.Annotation>> |
getEnabledDeploymentTypes()
A strongly ordered, unmodifiable list of enabled deployment types |
|
|
getInstance(Bean<T> bean)
Returns an instance of a bean |
|
java.lang.Object |
getInstanceByName(java.lang.String name)
Gets an instance by name, returning null if none is found and throwing an exception if too many beans match |
|
|
getInstanceByType(AnnotatedItem<T,?> element,
java.lang.annotation.Annotation... bindings)
Resolve an instance, verify that the resolved bean can be instantiated, and return |
|
|
getInstanceByType(java.lang.Class<T> type,
java.lang.annotation.Annotation... bindings)
Returns an instance by API type and binding types |
|
|
getInstanceByType(TypeLiteral<T> type,
java.lang.annotation.Annotation... bindings)
Returns an instance by type literal and binding types |
|
|
getMostSpecializedInstance(Bean<T> bean,
boolean create)
|
|
Resolver |
getResolver()
Get the web bean resolver. |
|
Manager |
parse(java.io.InputStream xmlStream)
|
|
|
removeObserver(Observer<T> observer,
java.lang.Class<T> eventType,
java.lang.annotation.Annotation... bindings)
Removes an observer |
|
|
removeObserver(Observer<T> observer,
TypeLiteral<T> eventType,
java.lang.annotation.Annotation... bindings)
Removes an observer |
|
java.util.Set<Bean<?>> |
resolveByName(java.lang.String name)
Resolves a set of beans based on their name |
|
|
resolveByType(AnnotatedItem<T,?> element,
java.lang.annotation.Annotation... bindings)
Check the resolution request is valid, and then ask the resolver to perform the resolution. |
|
|
resolveByType(java.lang.Class<T> type,
java.lang.annotation.Annotation... bindings)
Resolves beans by API type and binding types |
|
|
resolveByType(TypeLiteral<T> type,
java.lang.annotation.Annotation... bindings)
Resolves beans by API type literal and binding types |
|
java.util.List<Decorator> |
resolveDecorators(java.util.Set<java.lang.Class<?>> types,
java.lang.annotation.Annotation... bindings)
Resolves a list of decorators based on API types and binding types |
|
|
resolveDisposalMethods(java.lang.Class<T> apiType,
java.lang.annotation.Annotation... bindings)
Resolve the disposal method for the given producer method. |
|
java.util.List<Interceptor> |
resolveInterceptors(InterceptionType type,
java.lang.annotation.Annotation... interceptorBindings)
Resolves a list of interceptors based on interception type and interceptor bindings |
|
|
resolveObservers(T event,
java.lang.annotation.Annotation... bindings)
Resolves observers for given event and bindings |
|
void |
setBeans(java.util.Set<AbstractBean<?,?>> beans)
Wraps a collection of beans into a thread safe list. |
|
Manager |
setCurrent()
|
|
void |
setEnabledDeploymentTypes(java.util.List<java.lang.Class<? extends java.lang.annotation.Annotation>> enabledDeploymentTypes)
Set the enabled deployment types |
|
java.lang.String |
toDetailedString()
|
|
java.lang.String |
toString()
Gets a string representation |
|
Manager |
validate()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String JNDI_KEY
| Constructor Detail |
|---|
public ManagerImpl()
enabledDeploymentTypes - any enabled deployment types, an empty set
if none are specified| Method Detail |
|---|
protected void checkEnabledDeploymentTypes()
enabledDeploymentTypes - The enabled deployment types from
web-beans.xmlpublic Manager addBean(Bean<?> bean)
addBean in interface Managerbean - The bean to register
Manager.addBean(javax.webbeans.manager.Bean)
public <T> java.util.Set<AnnotatedMethod<java.lang.Object>> resolveDisposalMethods(java.lang.Class<T> apiType,
java.lang.annotation.Annotation... bindings)
apiType - The API type to matchbindingTypes - The binding types to match
public <T> java.util.Set<Observer<T>> resolveObservers(T event,
java.lang.annotation.Annotation... bindings)
resolveObservers in interface Managerevent - The event to matchbindings - The binding types to match
Manager.resolveObservers(java.lang.Object,
java.lang.annotation.Annotation[])public java.util.List<java.lang.Class<? extends java.lang.annotation.Annotation>> getEnabledDeploymentTypes()
public void setEnabledDeploymentTypes(java.util.List<java.lang.Class<? extends java.lang.annotation.Annotation>> enabledDeploymentTypes)
enabledDeploymentTypes -
public <T> java.util.Set<Bean<T>> resolveByType(java.lang.Class<T> type,
java.lang.annotation.Annotation... bindings)
resolveByType in interface Managertype - The API type to matchbindingTypes - The binding types to match
Manager.resolveByType(java.lang.Class,
java.lang.annotation.Annotation[])
public <T> java.util.Set<Bean<T>> resolveByType(TypeLiteral<T> type,
java.lang.annotation.Annotation... bindings)
resolveByType in interface Managertype - The API type literal to matchbindingTypes - The binding types to match
Manager.resolveByType(javax.webbeans.TypeLiteral,
java.lang.annotation.Annotation[])
public <T> java.util.Set<Bean<T>> resolveByType(AnnotatedItem<T,?> element,
java.lang.annotation.Annotation... bindings)
element - The item to resolvebindingTypes - The binding types to match
public void setBeans(java.util.Set<AbstractBean<?,?>> beans)
beans - The set of beans to addpublic java.util.Map<java.lang.Class<?>,Bean<?>> getBeanMap()
public java.util.List<Bean<?>> getBeans()
public Manager addContext(Context context)
addContext in interface Managercontext - The context to add
Manager.addContext(javax.webbeans.manager.Context)public Manager addDecorator(Decorator decorator)
addDecorator in interface Managerdecorator - The decorator to register
Manager.addDecorator(javax.webbeans.manager.Decorator)public Manager addInterceptor(Interceptor interceptor)
addInterceptor in interface Managerinterceptor - The interceptor to register
Manager.addInterceptor(javax.webbeans.manager.Interceptor)
public <T> Manager addObserver(Observer<T> observer,
java.lang.Class<T> eventType,
java.lang.annotation.Annotation... bindings)
addObserver in interface Managerobserver - The observer to registereventType - The event type to matchbindings - The bindings to match
Manager.addObserver(javax.webbeans.Observer,
java.lang.Class, java.lang.annotation.Annotation[])
public <T> Manager addObserver(Observer<T> observer,
TypeLiteral<T> eventType,
java.lang.annotation.Annotation... bindings)
addObserver in interface Managerobserver - The observer to registereventType - The event type literal to matchbindings - The bindings to match
Manager.addObserver(javax.webbeans.Observer,
javax.webbeans.TypeLiteral, java.lang.annotation.Annotation[])
public void fireEvent(java.lang.Object event,
java.lang.annotation.Annotation... bindings)
fireEvent in interface Managerevent - The event object to pass alongbindings - The binding types to matchManager.fireEvent(java.lang.Object,
java.lang.annotation.Annotation[])public Context getContext(java.lang.Class<? extends java.lang.annotation.Annotation> scopeType)
getContext in interface ManagerscopeType - The scope to match
Manager.getContext(java.lang.Class)public Context getBuiltInContext(java.lang.Class<? extends java.lang.annotation.Annotation> scopeType)
scopeType - The scope type of the context
public <T> T getInstance(Bean<T> bean)
getInstance in interface Managerbean - The bean to instantiate
Manager.getInstance(javax.webbeans.manager.Bean)public java.lang.Object getInstanceByName(java.lang.String name)
getInstanceByName in interface Managername - The name to match
Manager.getInstanceByName(java.lang.String)
public <T> T getInstanceByType(java.lang.Class<T> type,
java.lang.annotation.Annotation... bindings)
getInstanceByType in interface Managertype - The API type to matchbindingTypes - The binding types to match
Manager.getInstanceByType(java.lang.Class,
java.lang.annotation.Annotation[])
public <T> T getMostSpecializedInstance(Bean<T> bean,
boolean create)
public <T> T getInstanceByType(TypeLiteral<T> type,
java.lang.annotation.Annotation... bindings)
getInstanceByType in interface Managertype - The type to matchbindingTypes - The binding types to match
Manager.getInstanceByType(javax.webbeans.TypeLiteral,
java.lang.annotation.Annotation[])
public <T> T getInstanceByType(AnnotatedItem<T,?> element,
java.lang.annotation.Annotation... bindings)
element - The annotated item to matchbindingTypes - The binding types to match
public <T> Manager removeObserver(Observer<T> observer,
java.lang.Class<T> eventType,
java.lang.annotation.Annotation... bindings)
removeObserver in interface Managerobserver - The observer to removeeventType - The event type to matchbindings - the binding types to match
Manager.removeObserver(javax.webbeans.Observer,
java.lang.Class, java.lang.annotation.Annotation[])
public <T> Manager removeObserver(Observer<T> observer,
TypeLiteral<T> eventType,
java.lang.annotation.Annotation... bindings)
removeObserver in interface Managerobserver - The observer to removeeventType - The event type to matchbindings - the binding types to match
Manager.removeObserver(javax.webbeans.Observer,
javax.webbeans.TypeLiteral, java.lang.annotation.Annotation[])public java.util.Set<Bean<?>> resolveByName(java.lang.String name)
resolveByName in interface ManagerThe - name to match
Manager.resolveByName(java.lang.String)
public java.util.List<Decorator> resolveDecorators(java.util.Set<java.lang.Class<?>> types,
java.lang.annotation.Annotation... bindings)
resolveDecorators in interface Managertypes - The set of API types to matchbindingTypes - The binding types to match
Manager.resolveDecorators(java.util.Set,
java.lang.annotation.Annotation[])
public java.util.List<Interceptor> resolveInterceptors(InterceptionType type,
java.lang.annotation.Annotation... interceptorBindings)
resolveInterceptors in interface Managertype - The interception type to resolveinterceptorBindings - The binding types to match
Manager.resolveInterceptors(javax.webbeans.manager.InterceptionType,
java.lang.annotation.Annotation[])public Resolver getResolver()
public EjbDescriptorCache getEjbDescriptorCache()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toDetailedString()
public Manager parse(java.io.InputStream xmlStream)
parse in interface Managerpublic Manager validate()
validate in interface Managerpublic Manager createChildManager()
createChildManager in interface Managerpublic Manager setCurrent()
setCurrent in interface Manager
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||