public abstract class ForwardingBeanManager extends Object implements BeanManager, Serializable
BeanManager
.Constructor and Description |
---|
ForwardingBeanManager() |
Modifier and Type | Method and Description |
---|---|
boolean |
areInterceptorBindingsEquivalent(Annotation interceptorBinding1,
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(Annotation qualifier1,
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(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,
Class<T> beanClass,
InjectionTargetFactory<T> injectionTargetFactory)
|
<T,X> Bean<T> |
createBean(BeanAttributes<T> attributes,
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(Object obj) |
void |
fireEvent(Object event,
Annotation... qualifiers)
Fire an event and notify observers.
|
Set<Bean<?>> |
getBeans(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.
|
Set<Bean<?>> |
getBeans(Type beanType,
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(Class<? extends 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(Class<T> extensionClass)
Obtains the container's instance of an Extension class declared in
META-INF/services . |
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. |
Set<Annotation> |
getInterceptorBindingDefinition(Class<? extends Annotation> bindingType)
Obtains the set of meta-annotations for a certain interceptor binding
type .
|
int |
getInterceptorBindingHashCode(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(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(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 . |
Object |
getReference(Bean<?> bean,
Type beanType,
CreationalContext<?> ctx)
Obtains a contextual reference for a certain bean and a certain bean type of the bean.
|
Set<Annotation> |
getStereotypeDefinition(Class<? extends Annotation> stereotype)
Obtains meta-annotations for a certain stereotype.
|
int |
hashCode() |
boolean |
isInterceptorBinding(Class<? extends Annotation> annotationType)
Test the given annotation type to determine if it is an interceptor
binding type .
|
boolean |
isNormalScope(Class<? extends Annotation> annotationType)
Test the given annotation type to determine if it is a normal scope type.
|
boolean |
isPassivatingScope(Class<? extends Annotation> annotationType)
Test the given annotation type to determine if it is a passivating scope type.
|
boolean |
isQualifier(Class<? extends Annotation> annotationType)
Test the given annotation type to determine if it is a qualifier type.
|
boolean |
isScope(Class<? extends Annotation> annotationType)
Test the given annotation type to determine if it is a scope type.
|
boolean |
isStereotype(Class<? extends Annotation> annotationType)
Test the given annotation type to determine if it is a stereotype.
|
<X> Bean<? extends X> |
resolve(Set<Bean<? extends X>> beans)
Apply the ambiguous dependency resolution rules to a set of beans.
|
List<Decorator<?>> |
resolveDecorators(Set<Type> types,
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.
|
List<Interceptor<?>> |
resolveInterceptors(InterceptionType type,
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> Set<ObserverMethod<? super T>> |
resolveObserverMethods(T event,
Annotation... qualifiers)
Return the set of observers for an event.
|
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 Object getReference(Bean<?> bean, Type beanType, CreationalContext<?> ctx)
BeanManager
Obtains a contextual reference for a certain bean and a certain bean type of the bean.
getReference
in interface BeanManager
bean
- 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 Object getInjectableReference(InjectionPoint ij, CreationalContext<?> ctx)
BeanManager
Obtains an injectable reference for a certain injection point.
getInjectableReference
in interface BeanManager
ij
- 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)
BeanManager
CreationalContext
for the given
contextual type, or for a non-contextual object.createCreationalContext
in interface BeanManager
contextual
- the Contextual
, or a null value in the case of a non-contextual
objectCreationalContext
public Set<Bean<?>> getBeans(Type beanType, Annotation... qualifiers)
BeanManager
getBeans
in interface BeanManager
beanType
- the required bean typequalifiers
- the required qualifierspublic Set<Bean<?>> getBeans(String name)
BeanManager
getBeans
in interface BeanManager
name
- the EL namepublic Bean<?> getPassivationCapableBean(String id)
BeanManager
PassivationCapable
bean with the given identifier.getPassivationCapableBean
in interface BeanManager
id
- 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(Set<Bean<? extends X>> beans)
BeanManager
resolve
in interface BeanManager
X
- a common type of the beansbeans
- a set of beans of the given typepublic void validate(InjectionPoint injectionPoint)
BeanManager
validate
in interface BeanManager
injectionPoint
- the injection point to validatepublic void fireEvent(Object event, Annotation... qualifiers)
BeanManager
fireEvent
in interface BeanManager
event
- the event objectqualifiers
- the event qualifierspublic <T> Set<ObserverMethod<? super T>> resolveObserverMethods(T event, Annotation... qualifiers)
BeanManager
resolveObserverMethods
in interface BeanManager
T
- the type of the eventevent
- the event objectqualifiers
- the event qualifierspublic List<Decorator<?>> resolveDecorators(Set<Type> types, Annotation... qualifiers)
BeanManager
resolveDecorators
in interface BeanManager
types
- the set of bean types of the decorated beanqualifiers
- the qualifiers declared by the decorated beanpublic List<Interceptor<?>> resolveInterceptors(InterceptionType type, Annotation... interceptorBindings)
BeanManager
resolveInterceptors
in interface BeanManager
type
- the type of the interceptioninterceptorBindings
- the interceptor bindingspublic boolean isScope(Class<? extends Annotation> annotationType)
BeanManager
isScope
in interface BeanManager
annotationType
- the annotation typepublic boolean isNormalScope(Class<? extends Annotation> annotationType)
BeanManager
isNormalScope
in interface BeanManager
annotationType
- the annotation typepublic boolean isPassivatingScope(Class<? extends Annotation> annotationType)
BeanManager
isPassivatingScope
in interface BeanManager
annotationType
- the annotation typepublic boolean isQualifier(Class<? extends Annotation> annotationType)
BeanManager
isQualifier
in interface BeanManager
annotationType
- the annotation typepublic boolean isInterceptorBinding(Class<? extends Annotation> annotationType)
BeanManager
isInterceptorBinding
in interface BeanManager
annotationType
- the annotation to testpublic boolean isStereotype(Class<? extends Annotation> annotationType)
BeanManager
isStereotype
in interface BeanManager
annotationType
- the annotation typepublic Set<Annotation> getInterceptorBindingDefinition(Class<? extends Annotation> bindingType)
BeanManager
getInterceptorBindingDefinition
in interface BeanManager
bindingType
- the interceptor binding typepublic Set<Annotation> getStereotypeDefinition(Class<? extends Annotation> stereotype)
BeanManager
getStereotypeDefinition
in interface BeanManager
stereotype
- the stereotypepublic boolean areQualifiersEquivalent(Annotation qualifier1, Annotation qualifier2)
BeanManager
Nonbinding
.areQualifiersEquivalent
in interface BeanManager
public boolean areInterceptorBindingsEquivalent(Annotation interceptorBinding1, Annotation interceptorBinding2)
BeanManager
Nonbinding
.areInterceptorBindingsEquivalent
in interface BeanManager
public int getQualifierHashCode(Annotation qualifier)
BeanManager
Nonbinding
.getQualifierHashCode
in interface BeanManager
qualifier
- the qualifier to considerpublic int getInterceptorBindingHashCode(Annotation interceptorBinding)
BeanManager
Nonbinding
.getInterceptorBindingHashCode
in interface BeanManager
interceptorBinding
- the interceptor binding to considerpublic Context getContext(Class<? extends Annotation> scopeType)
BeanManager
getContext
in interface BeanManager
scopeType
- the scopepublic ELResolver getELResolver()
BeanManager
ELResolver
that resolves beans by EL name.getELResolver
in interface BeanManager
public ExpressionFactory wrapExpressionFactory(ExpressionFactory expressionFactory)
BeanManager
ExpressionFactory
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 BeanManager
expressionFactory
- the ExpressionFactory
to wrapExpressionFactory
public <T> AnnotatedType<T> createAnnotatedType(Class<T> type)
BeanManager
AnnotatedType
that may be used to read the annotations of the given class or interface.createAnnotatedType
in interface BeanManager
T
- the class or interfacetype
- the Class
objectAnnotatedType
public <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 BeanManager
T
- the typetype
- the AnnotatedType
public <T> BeanAttributes<T> createBeanAttributes(AnnotatedType<T> type)
BeanManager
BeanAttributes
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 BeanManager
T
- the typetype
- the AnnotatedType
InjectionTarget
public BeanAttributes<?> createBeanAttributes(AnnotatedMember<?> type)
BeanManager
BeanAttributes
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 BeanManager
type
- the AnnotatedType
InjectionTarget
public <T> Bean<T> createBean(BeanAttributes<T> attributes, 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
. #getInjectionTargetFactory()
allows use of a container created
InjectionTarget
.
createBean
in interface BeanManager
T
- 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 InjectionTarget
Bean
public <T,X> Bean<T> createBean(BeanAttributes<T> attributes, 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
.
#getProducerFactory()
allows use of a container created Producer
.
createBean
in interface BeanManager
T
- 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 Producer
Bean
public InjectionPoint createInjectionPoint(AnnotatedField<?> field)
BeanManager
InjectionPoint
for the given AnnotatedField
.createInjectionPoint
in interface BeanManager
field
- the AnnotatedField
defining the injection pointInjectionPoint
public InjectionPoint createInjectionPoint(AnnotatedParameter<?> parameter)
BeanManager
InjectionPoint
for the given AnnotatedParameter
.createInjectionPoint
in interface BeanManager
parameter
- the AnnotatedParameter
defining the injection pointInjectionPoint
public <T extends Extension> T getExtension(Class<T> extensionClass)
BeanManager
META-INF/services
.getExtension
in interface BeanManager
T
- the type of the extensionextensionClass
- the type of the extension classpublic <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 BeanManager
annotatedType
- the annotated type to create the injection target factory forInjectionTargetFactory
public <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 BeanManager
field
- 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 BeanManager
method
- 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 © 2013 Seam Framework. All Rights Reserved.