|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.webbeans.ManagerImpl
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
|
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)
Register an observer with the container |
|
|
addObserver(Observer<T> observer,
TypeLiteral<T> eventType,
java.lang.annotation.Annotation... bindings)
Register an observer with the container |
|
|
addObserver(ObserverImpl<T> observer)
Shortcut to register an ObserverImpl |
|
|
addObserverByType(Observer<T> observer,
java.lang.reflect.Type eventType,
java.lang.annotation.Annotation... bindings)
Does the actual observer registration |
|
protected void |
addWebBeansDeploymentTypes()
|
|
protected void |
checkEnabledDeploymentTypes()
Set up the enabled deployment types, if none are specified by the user, the default @Production and @Standard are used. |
|
ManagerImpl |
createActivity()
Create a new child activity. |
|
void |
fireEvent(java.lang.Object event,
java.lang.annotation.Annotation... bindings)
Fires an event object with given event object for given bindings |
|
|
getBeanByType(AnnotatedItem<T,?> element,
java.lang.annotation.Annotation... bindings)
|
|
java.util.List<Bean<?>> |
getBeans()
The beans registered with the Web Bean manager. |
|
protected ClientProxyProvider |
getClientProxyProvider()
|
|
Context |
getContext(java.lang.Class<? extends java.lang.annotation.Annotation> scopeType)
Gets an active context of the given scope. |
|
protected ConcurrentListMultiMap<java.lang.Class<? extends java.lang.annotation.Annotation>,Context> |
getContexts()
|
|
ManagerImpl |
getCurrent()
|
|
protected java.util.Set<org.jboss.webbeans.ManagerImpl.CurrentActivity> |
getCurrentActivities()
|
|
java.util.List<java.lang.Class<? extends java.lang.annotation.Annotation>> |
getEnabledDeploymentTypes()
A strongly ordered, unmodifiable list of enabled deployment types |
|
java.lang.Integer |
getId()
|
|
protected java.util.concurrent.atomic.AtomicInteger |
getIds()
|
|
InjectionPoint |
getInjectionPoint()
Accesses the factory used to create each instance of InjectionPoint that is injected into web beans. |
|
|
getInstance(Bean<T> bean)
Returns an instance of a bean |
|
|
getInstance(Bean<T> bean,
boolean create)
|
|
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 |
|
|
getInstanceToInject(InjectionPoint injectionPoint)
Obtains an instance of bean for a given injection point. |
|
|
getInstanceToInject(InjectionPoint injectionPoint,
CreationalContext<?> creationalContext)
Obtains an instance of bean for a given injection point. |
|
java.util.Map<java.lang.Class<?>,EnterpriseBean<?>> |
getNewEnterpriseBeanMap()
Gets the class-mapped beans. |
|
ConcurrentSetMultiMap<java.lang.reflect.Type,EventObserver<?>> |
getRegisteredObservers()
|
|
Resolver |
getResolver()
Get the web bean resolver. |
|
java.util.Map<java.lang.String,RIBean<?>> |
getRiBeans()
|
|
Namespace |
getRootNamespace()
|
|
ServiceRegistry |
getServices()
|
|
java.util.Map<Bean<?>,Bean<?>> |
getSpecializedBeans()
|
|
java.util.concurrent.ExecutorService |
getTaskExecutor()
Provides access to the executor service used for asynchronous tasks. |
|
void |
injectNonContextualInstance(java.lang.Object instance)
Perform JSR-299 dependency injection into a non-contextual instance |
|
static ManagerImpl |
newChildManager(ManagerImpl parentManager)
Create a new child manager |
|
static ManagerImpl |
newRootManager(ServiceRegistry serviceRegistry)
Create a new, root, manager |
|
Manager |
parse(java.io.InputStream xmlStream)
Allows additional XML based to be provided. |
|
protected java.lang.Object |
readResolve()
|
|
protected void |
registerBeanNamespace(Bean<?> bean)
|
|
|
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(AnnotatedItem<T,?> element,
InjectionPoint injectionPoint,
java.lang.annotation.Annotation... bindings)
|
|
|
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.reflect.Type> types,
java.lang.annotation.Annotation... bindings)
Resolves a list of decorators based on API types and binding types Os |
|
|
resolveDisposalBeans(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<RIBean<?>> beans)
Wraps a collection of beans into a thread safe list. |
|
ManagerImpl |
setCurrent(java.lang.Class<? extends java.lang.annotation.Annotation> scopeType)
Associate an activity with the current context for a normal scope |
|
void |
setEnabledDeploymentTypes(java.util.List<java.lang.Class<? extends java.lang.annotation.Annotation>> enabledDeploymentTypes)
Set the enabled deployment types |
|
void |
shutdown()
|
|
protected void |
shutdownExecutors()
Shuts down any executor services in the manager. |
|
java.lang.String |
toString()
Gets a string representation |
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
Method Detail |
---|
public static ManagerImpl newRootManager(ServiceRegistry serviceRegistry)
serviceRegistry
-
public static ManagerImpl newChildManager(ManagerImpl parentManager)
parentManager
-
protected void checkEnabledDeploymentTypes()
enabledDeploymentTypes
- The enabled deployment types from
web-beans.xmlprotected void addWebBeansDeploymentTypes()
public Manager addBean(Bean<?> bean)
addBean
in interface Manager
bean
- The bean to register
Manager.addBean(javax.inject.manager.Bean)
public <T> java.util.Set<DisposalMethodBean<T>> resolveDisposalBeans(java.lang.Class<T> apiType, java.lang.annotation.Annotation... bindings)
apiType
- The API type to matchbindings
- The binding types to match
public <T> java.util.Set<Observer<T>> resolveObservers(T event, java.lang.annotation.Annotation... bindings)
resolveObservers
in interface Manager
T
- the type of the event to obtainevent
- 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 Manager
T
- the type of the beans to be resolvedtype
- The API type to matchbindings
- 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 Manager
T
- the type of the beans to be resolvedtype
- The API type literal to matchbindings
- The binding types to match
Manager.resolveByType(javax.inject.TypeLiteral,
java.lang.annotation.Annotation[])
public <T> java.util.Set<Bean<T>> resolveByType(AnnotatedItem<T,?> element, InjectionPoint injectionPoint, java.lang.annotation.Annotation... bindings)
public <T> java.util.Set<Bean<T>> resolveByType(AnnotatedItem<T,?> element, java.lang.annotation.Annotation... bindings)
element
- The item to resolvebindings
- The binding types to match
public void setBeans(java.util.Set<RIBean<?>> beans)
beans
- The set of beans to addprotected void registerBeanNamespace(Bean<?> bean)
public java.util.Map<java.lang.Class<?>,EnterpriseBean<?>> getNewEnterpriseBeanMap()
public java.util.List<Bean<?>> getBeans()
public java.util.Map<java.lang.String,RIBean<?>> getRiBeans()
public Manager addContext(Context context)
addContext
in interface Manager
context
- The context to add
Manager.addContext(javax.context.Context)
public Manager addDecorator(Decorator decorator)
addDecorator
in interface Manager
decorator
- The decorator to register
Manager.addDecorator(javax.inject.manager.Decorator)
public Manager addInterceptor(Interceptor interceptor)
addInterceptor
in interface Manager
interceptor
- The interceptor to register
Manager.addInterceptor(javax.inject.manager.Interceptor)
public <T> Manager addObserver(Observer<T> observer, java.lang.Class<T> eventType, java.lang.annotation.Annotation... bindings)
Manager
addObserver
in interface Manager
T
- the type of the observerobserver
- the observer to registereventType
- the event type the observer observesbindings
- event bindings to further restrict the events observed
public <T> Manager addObserver(ObserverImpl<T> observer)
T
- observer
-
public <T> Manager addObserver(Observer<T> observer, TypeLiteral<T> eventType, java.lang.annotation.Annotation... bindings)
Manager
addObserver
in interface Manager
T
- the type of the observerobserver
- the observer to registereventType
- the event type the observer observesbindings
- event bindings to further restrict the events observed
public <T> Manager addObserverByType(Observer<T> observer, java.lang.reflect.Type eventType, java.lang.annotation.Annotation... bindings)
T
- observer
- eventType
- bindings
-
public void fireEvent(java.lang.Object event, java.lang.annotation.Annotation... bindings)
fireEvent
in interface Manager
event
- 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 Manager
scopeType
- The scope to match
Manager.getContext(java.lang.Class)
public <T> T getInstance(Bean<T> bean)
getInstance
in interface Manager
T
- the type of the beanbean
- The bean to instantiate
Manager.getInstance(javax.inject.manager.Bean)
public <T> T getInstance(Bean<T> bean, boolean create)
public <T> T getInstanceToInject(InjectionPoint injectionPoint)
Manager
getInstanceToInject
in interface Manager
T
- the type of the beaninjectionPoint
- the injection point the instance is needed for
public void injectNonContextualInstance(java.lang.Object instance)
WebBeansManager
injectNonContextualInstance
in interface WebBeansManager
instance
- the instance to injectpublic <T> T getInstanceToInject(InjectionPoint injectionPoint, CreationalContext<?> creationalContext)
Manager
getInstanceToInject
in interface Manager
T
- the type of the beaninjectionPoint
- the injection point the instance is needed forcreationalContext
- the context in which the injection is occurring
public java.lang.Object getInstanceByName(java.lang.String name)
getInstanceByName
in interface Manager
name
- 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 Manager
T
- the type of the bean to obtaintype
- The API type to matchbindings
- The binding types to match
Manager.getInstanceByType(java.lang.Class,
java.lang.annotation.Annotation[])
public <T> T getInstanceByType(TypeLiteral<T> type, java.lang.annotation.Annotation... bindings)
getInstanceByType
in interface Manager
T
- the type of the bean to obtaintype
- The type to matchbindings
- The binding types to match
Manager.getInstanceByType(javax.inject.TypeLiteral,
java.lang.annotation.Annotation[])
public <T> T getInstanceByType(AnnotatedItem<T,?> element, java.lang.annotation.Annotation... bindings)
element
- The annotated item to matchbindings
- The binding types to match
public <T> Bean<T> getBeanByType(AnnotatedItem<T,?> element, java.lang.annotation.Annotation... bindings)
public <T> Manager removeObserver(Observer<T> observer, java.lang.Class<T> eventType, java.lang.annotation.Annotation... bindings)
removeObserver
in interface Manager
T
- the type of the observerobserver
- The observer to removeeventType
- The event type to matchbindings
- the binding types to match
Manager.removeObserver(javax.event.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 Manager
T
- the type of the observerobserver
- The observer to removeeventType
- The event type to matchbindings
- the binding types to match
Manager.removeObserver(javax.event.Observer,
javax.inject.TypeLiteral, java.lang.annotation.Annotation[])
public java.util.Set<Bean<?>> resolveByName(java.lang.String name)
resolveByName
in interface Manager
The
- name to match
Manager.resolveByName(java.lang.String)
public java.util.List<Decorator> resolveDecorators(java.util.Set<java.lang.reflect.Type> types, java.lang.annotation.Annotation... bindings)
resolveDecorators
in interface Manager
types
- The set of API types to matchbindings
- 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 Manager
type
- The interception type to resolveinterceptorBindings
- The binding types to match
Manager.resolveInterceptors(javax.inject.manager.InterceptionType,
java.lang.annotation.Annotation[])
public Resolver getResolver()
public java.lang.String toString()
toString
in class java.lang.Object
public Manager parse(java.io.InputStream xmlStream)
Manager
parse
in interface Manager
xmlStream
- the XML metadata
public ManagerImpl createActivity()
Manager
createActivity
in interface Manager
public ManagerImpl setCurrent(java.lang.Class<? extends java.lang.annotation.Annotation> scopeType)
Manager
setCurrent
in interface Manager
scopeType
- the scope to associate the activity with
public ManagerImpl getCurrent()
public ServiceRegistry getServices()
public InjectionPoint getInjectionPoint()
public java.util.Map<Bean<?>,Bean<?>> getSpecializedBeans()
protected java.lang.Object readResolve()
public java.util.concurrent.ExecutorService getTaskExecutor()
public void shutdown()
shutdown
in interface WebBeansManager
protected void shutdownExecutors()
protected ClientProxyProvider getClientProxyProvider()
protected ConcurrentListMultiMap<java.lang.Class<? extends java.lang.annotation.Annotation>,Context> getContexts()
protected java.util.concurrent.atomic.AtomicInteger getIds()
protected java.util.Set<org.jboss.webbeans.ManagerImpl.CurrentActivity> getCurrentActivities()
public java.lang.Integer getId()
public ConcurrentSetMultiMap<java.lang.reflect.Type,EventObserver<?>> getRegisteredObservers()
public Namespace getRootNamespace()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |