Allows a portable extension to interact directly with the container. Provides operations for obtaining contextual references for beans, along with many other operations of use to portable extensions.
Any bean may obtain an instance of BeanManager by injecting it:
@Inject BeanManager manager;
Java EE components may obtain an instance of BeanManager from JNDI by looking up the name
java:comp/BeanManager.
Most operations of BeanManager may be called at any time during the execution of the application.
However, the following operations must not be called before the AfterBeanDiscovery event is fired:
getBeans(String),getBeans(java.lang.reflect.Type, java.lang.annotation.Annotation...),getPassivationCapableBean(String),resolve(java.util.Set),resolveDecorators(java.util.Set, java.lang.annotation.Annotation...),resolveInterceptors(InterceptionType, java.lang.annotation.Annotation...),resolveObserverMethods(Object, java.lang.annotation.Annotation...),validate(InjectionPoint),createInstance()
and the following operations must not be called before the AfterDeploymentValidation event is fired:
getReference(Bean, java.lang.reflect.Type, javax.enterprise.context.spi.CreationalContext),getInjectableReference(InjectionPoint, javax.enterprise.context.spi.CreationalContext),or the container will throw an Exception.
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if the two interceptor bindings are equivalent, otherwise falsean interceptor binding to check interceptorBinding1, Annotation an interceptor binding to check interceptorBinding2)Determine if two interceptor bindings are considered equivalent for the purposes of typesafe resolution, taking into
account any members annotated with |
| public boolean | Returns: true if the two qualifiers are equivalent, otherwise falsea qualifier to check qualifier1, Annotation a qualifier to check qualifier2)Determine if two qualifiers are considered equivalent for the purposes of typesafe resolution, taking into account any
members annotated with |
| public < the class or interface T> AnnotatedType | Returns: theAnnotatedTypethe type)java.lang.Class objectObtain an |
| public < the type T> Bean | Returns: a container provided implementation ofBeana attributes, Class<T> BeanAttributes which determines the bean types, qualifiers, scope, name and stereotypes of
the returned Bean, and the return values of Bean#isAlternative() and Bean#isNullable()a class, which determines the return value of beanClass, InjectionTargetFactory<T> Bean#getBeanClass()an injectionTargetFactory)InjectionTargetFactory, used to obtain an InjectionTarget
Obtains a |
| public < the type T, the type of the declaring bean X> Bean | Returns: a container provided implementation ofBeana attributes, Class<X> BeanAttributes which determines the bean types, qualifiers, scope, name and stereotypes of
the returned Bean, and the return values of Bean#isAlternative() and Bean#isNullable()a class, which determines the return value of Bean.getClass() beanClass, ProducerFactory<X> a producerFactory)ProducerFactory, used to obtain a Producer
Obtains a |
| public < the type T> BeanAttributes | Returns: a container provided implementation ofInjectionTargetthe type)AnnotatedTypeObtains a |
| public BeanAttributes | Returns: a container provided implementation ofInjectionTargetthe type)AnnotatedTypeObtains a |
| public <T> CreationalContext | Returns: the newjavax.enterprise.context.spi.CreationalContextthe contextual)javax.enterprise.context.spi.Contextual, or a null value in the case of a non-contextual
objectObtain an instance of a |
| public InjectionPoint | Returns: the container providedInjectionPointthe field)AnnotatedField defining the injection pointObtains a container provided implementation of |
| public InjectionPoint | Returns: the container providedInjectionPointthe parameter)AnnotatedParameter defining the injection pointObtains a container provided implementation of |
| public < the type T> InjectionTarget | Returns: a container provided implementation ofInjectionTargetthe type)AnnotatedType
Obtains an |
| public Instance | Returns: anInstance object to request beans instancesObtains an |
| public < type of the instance this factory will work on T> InterceptionFactory | Returns: a newInterceptionFactory to add services on on instances of TCreationalContext for the InterceptionFactory to createclass of the instance this factory will work on clazz)Create an |
| public void | fireEvent(Object
the event object event, Annotation... the event qualifiers qualifiers)Fire an event and notify observers. |
| public Set | Returns: the resulting set of beansthe required bean type beanType, Annotation... the required qualifiers qualifiers)Return the set of beans which have the given required type and qualifiers and are available for injection in the module or library containing the class into which the BeanManager was injected or the Java EE component from whose JNDI environment namespace the BeanManager was obtained, according to the rules of typesafe resolution. |
| public Set | Returns: the resulting set of beansthe EL name name)Return the set of beans which have the given EL name and are available for injection in the module or library containing the class into which the BeanManager was injected or the Java EE component from whose JNDI environment namespace the BeanManager was obtained, according to the rules of EL name resolution. |
| public Context | Returns: the context objectthe scope scopeType)Obtains an active context object for the given scope . |
| public ELResolver | Returns: thejavax.el.ELResolverReturns a |
| public Event | |
| public < the type of the extension T extends Extension> T | Returns: the extension instancethe type of the extension class extensionClass)Obtains the container's instance of an Extension class declared in |
| public Object | Returns: the injectable referencethe target injection point ij, CreationalContext<?> a ctx)javax.enterprise.context.spi.CreationalContext that may be used to destroy any object with scope
javax.enterprise.context.Dependent that is createdObtains an injectable reference for a certain injection point. |
| public <T> InjectionTargetFactory | Returns: anInjectionTargetFactorythe annotated type to create the injection target factory for annotatedType)
An implementation of |
| public Set | Returns: the set of meta-annotationsObtains the set of meta-annotations for a certain interceptor binding type . |
| public int | Returns: the hashCode for the interceptor bindingthe interceptor binding to consider interceptorBinding)Determine the hash code of an interceptor binding, using the JDK algorithm for determining an annotation hash code,
ignoring any members annotated with |
| public Bean | Returns: aBean that implements javax.enterprise.inject.spi.PassivationCapable and has the given
identifier, or a null value if there is no such beanthe identifier id)Returns the |
| public <X> ProducerFactory | Returns: the producer factory for the fieldthe field to create the producer factory for field, Bean<X> the bean declaring the producer. May be null if the producer is static or the declaring object is
non-contextual declaringBean)
An implementation of |
| public <X> ProducerFactory | Returns: the producer factory for the methodthe method to create the producer factory for method, Bean<X> the bean declaring the producer. May be null if the producer is static or the declaring object is
non-contextual declaringBean)
An implementation of |
| public int | Returns: the hashCode for the qualifierthe qualifier to consider qualifier)Determine the hash code of a qualifier, using the JDK algorithm for determining an annotation hash code, ignoring any
members annotated with |
| public Object | Returns: a contextual reference representing the beanthe bean, Type Bean object representing the beana bean type that must be implemented by any client proxy that is returned beanType, CreationalContext<?> a ctx)javax.enterprise.context.spi.CreationalContext that may be used to destroy any object with scope
javax.enterprise.context.Dependent that is createdObtains a contextual reference for a certain bean and a certain bean type of the bean. |
| public Set | Returns: the set of meta-annotationsthe stereotype stereotype)Obtains meta-annotations for a certain stereotype. |
| public boolean | Returns: true if the annotation type is a interceptor binding typethe annotation to test annotationType)Test the given annotation type to determine if it is an interceptor binding type . |
| public boolean | Returns: true if the annotation type is a normal scope typethe annotation type annotationType)Test the given annotation type to determine if it is a normal scope type. |
| public boolean | Returns: true if the annotation type is a passivating scope typethe annotation type annotationType)Test the given annotation type to determine if it is a passivating scope type. |
| public boolean | Returns: true if the annotation type is a qualifier typethe annotation type annotationType)Test the given annotation type to determine if it is a qualifier type. |
| public boolean | Returns: true if the annotation type is a scope typethe annotation type annotationType)Test the given annotation type to determine if it is a scope type. |
| public boolean | Returns: true if the annotation type is a stereotypethe annotation type annotationType)Test the given annotation type to determine if it is a stereotype. |
| public < a common type of the beans X> Bean | |
| public List | Returns: the resulting set of decoratorsthe set of bean types of the decorated bean types, Annotation... the qualifiers declared by the decorated bean qualifiers)Return an ordered list of decorators for a set of bean types and a set of qualifiers and which are enabled in the module or library containing the class into which the BeanManager was injected or the Java EE component from whose JNDI environment namespace the BeanManager was obtained. |
| public List | Returns: the resulting set of interceptorsthe type of the interception type, Annotation... the interceptor bindings interceptorBindings)Return an ordered list of enabled interceptors for a set of interceptor bindings and a type of interception and which are enabled in the module or library containing the class into which the BeanManager was injected or the Java EE component from whose JNDI environment namespace the BeanManager was obtained. |
| public < the type of the event T> Set | Returns: the resulting set of observer methodsthe event object event, Annotation... the event qualifiers qualifiers)Return an ordered set of observer methods for an event. |
| public void | validate(InjectionPoint
the injection point to validate injectionPoint)Validate a certain injection point. |
| public ExpressionFactory | Returns: the wrappedjavax.el.ExpressionFactorythe expressionFactory)javax.el.ExpressionFactory to wrapReturns a wrapper |