public abstract class ForwardingBeanManager extends java.lang.Object implements BeanManager, java.io.Serializable
BeanManager.| Constructor and Description |
|---|
ForwardingBeanManager() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
areInterceptorBindingsEquivalent(java.lang.annotation.Annotation interceptorBinding1,
java.lang.annotation.Annotation interceptorBinding2)
Determine if two interceptor bindings are considered equivalent for the purposes of typesafe resolution, taking into
account any members annotated with
Nonbinding. |
boolean |
areQualifiersEquivalent(java.lang.annotation.Annotation qualifier1,
java.lang.annotation.Annotation qualifier2)
Determine if two qualifiers are considered equivalent for the purposes of typesafe resolution, taking into account any
members annotated with
Nonbinding. |
<T> AnnotatedType<T> |
createAnnotatedType(java.lang.Class<T> type)
Obtain an
AnnotatedType that may be used to read the annotations of the given class or interface. |
<T> Bean<T> |
createBean(BeanAttributes<T> attributes,
java.lang.Class<T> beanClass,
InjectionTargetFactory<T> injectionTargetFactory)
|
<T,X> Bean<T> |
createBean(BeanAttributes<T> attributes,
java.lang.Class<X> beanClass,
ProducerFactory<X> producerFactory)
|
BeanAttributes<?> |
createBeanAttributes(AnnotatedMember<?> type)
Obtains a
BeanAttributes for the given AnnotatedType. |
<T> BeanAttributes<T> |
createBeanAttributes(AnnotatedType<T> type)
Obtains a
BeanAttributes for the given AnnotatedType. |
<T> CreationalContext<T> |
createCreationalContext(Contextual<T> contextual)
Obtain an instance of a
CreationalContext for the given
contextual type, or for a non-contextual object. |
InjectionPoint |
createInjectionPoint(AnnotatedField<?> field)
Obtains a container provided implementation of
InjectionPoint for the given AnnotatedField. |
InjectionPoint |
createInjectionPoint(AnnotatedParameter<?> parameter)
Obtains a container provided implementation of
InjectionPoint for the given AnnotatedParameter. |
<T> InjectionTarget<T> |
createInjectionTarget(AnnotatedType<T> type)
Obtains an
InjectionTarget for the given AnnotatedType. |
abstract BeanManager |
delegate() |
boolean |
equals(java.lang.Object obj) |
void |
fireEvent(java.lang.Object event,
java.lang.annotation.Annotation... qualifiers)
Fire an event and notify observers.
|
java.util.Set<Bean<?>> |
getBeans(java.lang.String 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.
|
java.util.Set<Bean<?>> |
getBeans(java.lang.reflect.Type beanType,
java.lang.annotation.Annotation... 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.
|
Context |
getContext(java.lang.Class<? extends java.lang.annotation.Annotation> scopeType)
Obtains an active context object for the given
scope .
|
ELResolver |
getELResolver()
Returns a
ELResolver that resolves beans by EL name. |
<T extends Extension> |
getExtension(java.lang.Class<T> extensionClass)
Obtains the container's instance of an Extension class declared in
META-INF/services. |
java.lang.Object |
getInjectableReference(InjectionPoint ij,
CreationalContext<?> ctx)
Obtains an injectable reference for a certain injection point.
|
<T> InjectionTargetFactory<T> |
getInjectionTargetFactory(AnnotatedType<T> annotatedType)
An implementation of
InjectionTargetFactory that provides container created InjectionTarget instances. |
java.util.Set<java.lang.annotation.Annotation> |
getInterceptorBindingDefinition(java.lang.Class<? extends java.lang.annotation.Annotation> bindingType)
Obtains the set of meta-annotations for a certain interceptor binding
type .
|
int |
getInterceptorBindingHashCode(java.lang.annotation.Annotation interceptorBinding)
Determine the hash code of an interceptor binding, using the JDK algorithm for determining an annotation hash code,
ignoring any members annotated with
Nonbinding. |
Bean<?> |
getPassivationCapableBean(java.lang.String id)
Returns the
PassivationCapable bean with the given identifier. |
<X> ProducerFactory<X> |
getProducerFactory(AnnotatedField<? super X> field,
Bean<X> declaringBean)
An implementation of
ProducerFactory that provides container created Producer instances for the given
field. |
<X> ProducerFactory<X> |
getProducerFactory(AnnotatedMethod<? super X> method,
Bean<X> declaringBean)
An implementation of
ProducerFactory that provides container created Producer instances for the given
method. |
int |
getQualifierHashCode(java.lang.annotation.Annotation qualifier)
Determine the hash code of a qualifier, using the JDK algorithm for determining an annotation hash code, ignoring any
members annotated with
Nonbinding. |
java.lang.Object |
getReference(Bean<?> bean,
java.lang.reflect.Type beanType,
CreationalContext<?> ctx)
Obtains a contextual reference for a certain bean and a certain bean type of the bean.
|
java.util.Set<java.lang.annotation.Annotation> |
getStereotypeDefinition(java.lang.Class<? extends java.lang.annotation.Annotation> stereotype)
Obtains meta-annotations for a certain stereotype.
|
int |
hashCode() |
boolean |
isInterceptorBinding(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Test the given annotation type to determine if it is an interceptor
binding type .
|
boolean |
isNormalScope(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Test the given annotation type to determine if it is a normal scope type.
|
boolean |
isPassivatingScope(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Test the given annotation type to determine if it is a passivating scope type.
|
boolean |
isQualifier(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Test the given annotation type to determine if it is a qualifier type.
|
boolean |
isScope(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Test the given annotation type to determine if it is a scope type.
|
boolean |
isStereotype(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Test the given annotation type to determine if it is a stereotype.
|
<X> Bean<? extends X> |
resolve(java.util.Set<Bean<? extends X>> beans)
Apply the ambiguous dependency resolution rules to a set of beans.
|
java.util.List<Decorator<?>> |
resolveDecorators(java.util.Set<java.lang.reflect.Type> types,
java.lang.annotation.Annotation... 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.
|
java.util.List<Interceptor<?>> |
resolveInterceptors(InterceptionType type,
java.lang.annotation.Annotation... 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.
|
<T> java.util.Set<ObserverMethod<? super T>> |
resolveObserverMethods(T event,
java.lang.annotation.Annotation... qualifiers)
Return the set of observers for an event.
|
java.lang.String |
toString() |
void |
validate(InjectionPoint injectionPoint)
Validate a certain injection point.
|
ExpressionFactory |
wrapExpressionFactory(ExpressionFactory expressionFactory)
Returns a wrapper
ExpressionFactory that delegates MethodExpression and
ValueExpression creation to the given ExpressionFactory. |
public abstract BeanManager delegate()
public java.lang.Object getReference(Bean<?> bean, java.lang.reflect.Type beanType, CreationalContext<?> ctx)
BeanManagerObtains a contextual reference for a certain bean and a certain bean type of the bean.
getReference in interface BeanManagerbean - the Bean object representing the beanbeanType - a bean type that must be implemented by any client proxy that is returnedctx - a CreationalContext that may be used to destroy any object with scope
Dependent that is createdpublic java.lang.Object getInjectableReference(InjectionPoint ij, CreationalContext<?> ctx)
BeanManagerObtains an injectable reference for a certain injection point.
getInjectableReference in interface BeanManagerij - the target injection pointctx - a CreationalContext that may be used to destroy any object with scope
Dependent that is createdpublic <T> CreationalContext<T> createCreationalContext(Contextual<T> contextual)
BeanManagerCreationalContext for the given
contextual type, or for a non-contextual object.createCreationalContext in interface BeanManagercontextual - the Contextual, or a null value in the case of a non-contextual
objectCreationalContextpublic java.util.Set<Bean<?>> getBeans(java.lang.reflect.Type beanType, java.lang.annotation.Annotation... qualifiers)
BeanManagerAfterBeanDiscovery event observer,
this method will only return beans discovered by the container before the AfterBeanDiscovery event is fired.getBeans in interface BeanManagerbeanType - the required bean typequalifiers - the required qualifierspublic java.util.Set<Bean<?>> getBeans(java.lang.String name)
BeanManagerAfterBeanDiscovery event observer,
this method will only return beans discovered by the container before the AfterBeanDiscovery event is fired.getBeans in interface BeanManagername - the EL namepublic Bean<?> getPassivationCapableBean(java.lang.String id)
BeanManagerPassivationCapable bean with the given identifier.
Note that when called during invocation of an AfterBeanDiscovery event observer,
this method will only return beans discovered by the container before the AfterBeanDiscovery event is fired.getPassivationCapableBean in interface BeanManagerid - the identifierBean that implements PassivationCapable and has the given
identifier, or a null value if there is no such beanpublic <X> Bean<? extends X> resolve(java.util.Set<Bean<? extends X>> beans)
BeanManagerAfterBeanDiscovery event observer,
this method will only return beans discovered by the container before the AfterBeanDiscovery event is fired.resolve in interface BeanManagerX - a common type of the beansbeans - a set of beans of the given typepublic void validate(InjectionPoint injectionPoint)
BeanManagerAfterBeanDiscovery event observer,
this method will only validate injection points discovered by the container before the AfterBeanDiscovery
event is fired.validate in interface BeanManagerinjectionPoint - the injection point to validatepublic void fireEvent(java.lang.Object event,
java.lang.annotation.Annotation... qualifiers)
BeanManagerfireEvent in interface BeanManagerevent - the event objectqualifiers - the event qualifierspublic <T> java.util.Set<ObserverMethod<? super T>> resolveObserverMethods(T event, java.lang.annotation.Annotation... qualifiers)
BeanManagerAfterBeanDiscovery event observer,
this method will only return observers discovered by the container before the AfterBeanDiscovery event is fired.resolveObserverMethods in interface BeanManagerT - the type of the eventevent - the event objectqualifiers - the event qualifierspublic java.util.List<Decorator<?>> resolveDecorators(java.util.Set<java.lang.reflect.Type> types, java.lang.annotation.Annotation... qualifiers)
BeanManagerAfterBeanDiscovery event observer,
this method will only return decorators discovered by the container before the AfterBeanDiscovery event is fired.resolveDecorators in interface BeanManagertypes - the set of bean types of the decorated beanqualifiers - the qualifiers declared by the decorated beanpublic java.util.List<Interceptor<?>> resolveInterceptors(InterceptionType type, java.lang.annotation.Annotation... interceptorBindings)
BeanManagerAfterBeanDiscovery event observer,
this method will only return interceptors discovered by the container before the AfterBeanDiscovery event is
fired.resolveInterceptors in interface BeanManagertype - the type of the interceptioninterceptorBindings - the interceptor bindingspublic boolean isScope(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
BeanManagerisScope in interface BeanManagerannotationType - the annotation typepublic boolean isNormalScope(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
BeanManagerisNormalScope in interface BeanManagerannotationType - the annotation typepublic boolean isPassivatingScope(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
BeanManagerisPassivatingScope in interface BeanManagerannotationType - the annotation typepublic boolean isQualifier(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
BeanManagerisQualifier in interface BeanManagerannotationType - the annotation typepublic boolean isInterceptorBinding(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
BeanManagerisInterceptorBinding in interface BeanManagerannotationType - the annotation to testpublic boolean isStereotype(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
BeanManagerisStereotype in interface BeanManagerannotationType - the annotation typepublic java.util.Set<java.lang.annotation.Annotation> getInterceptorBindingDefinition(java.lang.Class<? extends java.lang.annotation.Annotation> bindingType)
BeanManagergetInterceptorBindingDefinition in interface BeanManagerbindingType - the interceptor binding typepublic java.util.Set<java.lang.annotation.Annotation> getStereotypeDefinition(java.lang.Class<? extends java.lang.annotation.Annotation> stereotype)
BeanManagergetStereotypeDefinition in interface BeanManagerstereotype - the stereotypepublic boolean areQualifiersEquivalent(java.lang.annotation.Annotation qualifier1,
java.lang.annotation.Annotation qualifier2)
BeanManagerNonbinding.areQualifiersEquivalent in interface BeanManagerqualifier1 - a qualifier to checkqualifier2 - a qualifier to checkpublic boolean areInterceptorBindingsEquivalent(java.lang.annotation.Annotation interceptorBinding1,
java.lang.annotation.Annotation interceptorBinding2)
BeanManagerNonbinding.areInterceptorBindingsEquivalent in interface BeanManagerinterceptorBinding1 - an interceptor binding to checkinterceptorBinding2 - an interceptor binding to checkpublic int getQualifierHashCode(java.lang.annotation.Annotation qualifier)
BeanManagerNonbinding.getQualifierHashCode in interface BeanManagerqualifier - the qualifier to considerpublic int getInterceptorBindingHashCode(java.lang.annotation.Annotation interceptorBinding)
BeanManagerNonbinding.getInterceptorBindingHashCode in interface BeanManagerinterceptorBinding - the interceptor binding to considerpublic Context getContext(java.lang.Class<? extends java.lang.annotation.Annotation> scopeType)
BeanManagergetContext in interface BeanManagerscopeType - the scopepublic ELResolver getELResolver()
BeanManagerELResolver that resolves beans by EL name.getELResolver in interface BeanManagerpublic ExpressionFactory wrapExpressionFactory(ExpressionFactory expressionFactory)
BeanManagerExpressionFactory that delegates MethodExpression and
ValueExpression creation to the given ExpressionFactory. When a Unified EL expression
is evaluated using a MethodExpression or ValueExpression returned by the wrapper
ExpressionFactory, the container handles destruction of objects with scope
Dependent.wrapExpressionFactory in interface BeanManagerexpressionFactory - the ExpressionFactory to wrapExpressionFactorypublic <T> AnnotatedType<T> createAnnotatedType(java.lang.Class<T> type)
BeanManagerAnnotatedType that may be used to read the annotations of the given class or interface.createAnnotatedType in interface BeanManagerT - the class or interfacetype - the Class objectAnnotatedTypepublic <T> InjectionTarget<T> createInjectionTarget(AnnotatedType<T> type)
BeanManager
Obtains an InjectionTarget for the given AnnotatedType. The container ignores the annotations and types
declared by the elements of the actual Java class and uses the metadata provided via the Annotated interface
instead.
This method is deprecated from CDI 1.1 and BeanManager.getInjectionTargetFactory(AnnotatedType) should be used instead.
createInjectionTarget in interface BeanManagerT - the typetype - the AnnotatedTypeInjectionTargetpublic <T> BeanAttributes<T> createBeanAttributes(AnnotatedType<T> type)
BeanManagerBeanAttributes for the given AnnotatedType. The container ignores the annotations and types
declared by the elements of the actual Java class and uses the metadata provided via the Annotated interface
instead.createBeanAttributes in interface BeanManagerT - the typetype - the AnnotatedTypeInjectionTargetpublic BeanAttributes<?> createBeanAttributes(AnnotatedMember<?> type)
BeanManagerBeanAttributes for the given AnnotatedType. The container ignores the annotations and types
declared by the elements of the actual Java class and uses the metadata provided via the Annotated interface
instead.createBeanAttributes in interface BeanManagertype - the AnnotatedTypeInjectionTargetpublic <T> Bean<T> createBean(BeanAttributes<T> attributes, java.lang.Class<T> beanClass, InjectionTargetFactory<T> injectionTargetFactory)
BeanManager
Obtains a Bean for the given BeanAttributes, bean class and InjectionTarget.
The InjectionTarget creates and destroys instances of the bean, performs dependency injection and lifecycle
callbacks, and determines the return value of Bean.getInjectionPoints(). The InjectionTarget is obtained
from the InjectionTargetFactory. BeanManager.getInjectionTargetFactory(AnnotatedType) allows use of a container created
InjectionTarget.
createBean in interface BeanManagerT - the typeattributes - a BeanAttributes which determines the bean types, qualifiers, scope, name and stereotypes of
the returned Bean, and the return values of BeanAttributes.isAlternative() and Bean.isNullable()beanClass - a class, which determines the return value of Bean.getBeanClass()injectionTargetFactory - an InjectionTargetFactory, used to obtain an InjectionTargetBeanpublic <T,X> Bean<T> createBean(BeanAttributes<T> attributes, java.lang.Class<X> beanClass, ProducerFactory<X> producerFactory)
BeanManager
Obtains a Bean for the given BeanAttributes, bean class and Producer.
The Producer creates and destroys instances of the decorator, and determines the return value of
Bean.getInjectionPoints(). The Producer is obtained from the ProducerFactory.
BeanManager.getProducerFactory(AnnotatedMethod, Bean) or BeanManager.getProducerFactory(AnnotatedField, Bean) allows use of a
container created Producer.
createBean in interface BeanManagerT - the typeX - the type of the declaring beanattributes - a BeanAttributes which determines the bean types, qualifiers, scope, name and stereotypes of
the returned Bean, and the return values of BeanAttributes.isAlternative() and Bean.isNullable()beanClass - a class, which determines the return value of Bean#getClass()producerFactory - a ProducerFactory, used to obtain a ProducerBeanpublic InjectionPoint createInjectionPoint(AnnotatedField<?> field)
BeanManagerInjectionPoint for the given AnnotatedField.createInjectionPoint in interface BeanManagerfield - the AnnotatedField defining the injection pointInjectionPointpublic InjectionPoint createInjectionPoint(AnnotatedParameter<?> parameter)
BeanManagerInjectionPoint for the given AnnotatedParameter.createInjectionPoint in interface BeanManagerparameter - the AnnotatedParameter defining the injection pointInjectionPointpublic <T extends Extension> T getExtension(java.lang.Class<T> extensionClass)
BeanManagerMETA-INF/services.getExtension in interface BeanManagerT - the type of the extensionextensionClass - the type of the extension classpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic <T> InjectionTargetFactory<T> getInjectionTargetFactory(AnnotatedType<T> annotatedType)
BeanManager
An implementation of InjectionTargetFactory that provides container created InjectionTarget instances.
This factory can be wrapped to add behavior to container created injection targets.
getInjectionTargetFactory in interface BeanManagerannotatedType - the annotated type to create the injection target factory forInjectionTargetFactorypublic <X> ProducerFactory<X> getProducerFactory(AnnotatedField<? super X> field, Bean<X> declaringBean)
BeanManager
An implementation of ProducerFactory that provides container created Producer instances for the given
field.
This factory can be wrapped to add behavior to container created producers.
getProducerFactory in interface BeanManagerfield - the field to create the producer factory fordeclaringBean - the bean declaring the producer. May be null if the producer is static or the declaring object is
non-contextualpublic <X> ProducerFactory<X> getProducerFactory(AnnotatedMethod<? super X> method, Bean<X> declaringBean)
BeanManager
An implementation of ProducerFactory that provides container created Producer instances for the given
method.
This factory can be wrapped to add behavior to container created producers.
getProducerFactory in interface BeanManagermethod - the method to create the producer factory fordeclaringBean - the bean declaring the producer. May be null if the producer is static or the declaring object is
non-contextualCopyright © 2015. All Rights Reserved.