public interface BeanManager
Manager provides operations for
obtaining the contextual instance of the webbeans. There are operations
related with;
There is always one root manager in the system. You can set the
current activity via call to the BeanManager#setCurrent(Class) method.
| Modifier and Type | Method and Description |
|---|---|
<T> AnnotatedType<T> |
createAnnotatedType(java.lang.Class<T> type)
Returns a
AnnotatedType instance for the given
class. |
<T> CreationalContext<T> |
createCreationalContext(Contextual<T> contextual)
Returns a new creational context implementation.
|
<T> InjectionTarget<T> |
createInjectionTarget(AnnotatedType<T> type)
Creates a new instance of injection target.
|
void |
fireEvent(java.lang.Object event,
java.lang.annotation.Annotation... qualifiers)
Fires an event with given even object and qualifiers.
|
java.util.Set<Bean<?>> |
getBeans(java.lang.String name)
Returns set of beans with given name.
|
java.util.Set<Bean<?>> |
getBeans(java.lang.reflect.Type beanType,
java.lang.annotation.Annotation... qualifiers)
Returns set of beans that their api types contain
given bean type and given qualifiers.
|
Context |
getContext(java.lang.Class<? extends java.lang.annotation.Annotation> scope)
Returns a context with given scope type.
|
javax.el.ELResolver |
getELResolver()
Returns el resolver.
|
java.lang.Object |
getInjectableReference(InjectionPoint injectionPoint,
CreationalContext<?> ctx)
Gets injection point bean reference.
|
java.util.Set<java.lang.annotation.Annotation> |
getInterceptorBindingDefinition(java.lang.Class<? extends java.lang.annotation.Annotation> qualifier)
Returns a set of meta-annotations that are defined on the binding
|
Bean<?> |
getPassivationCapableBean(java.lang.String id)
Returns passivation capable bean given id.
|
java.lang.Object |
getReference(Bean<?> bean,
java.lang.reflect.Type beanType,
CreationalContext<?> ctx)
Returns a bean instance reference for the given bean.
|
java.util.Set<java.lang.annotation.Annotation> |
getStereotypeDefinition(java.lang.Class<? extends java.lang.annotation.Annotation> stereotype)
Returns a set of meta-annotations that are defined on the stereotype type.
|
boolean |
isInterceptorBinding(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Returns true if given type is a interceptor binding, false otherwise.
|
boolean |
isNormalScope(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Returns true if given type is a normal scope type, false otherwise.
|
boolean |
isPassivatingScope(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Returns true if given type is a passivating scope type, false otherwise.
|
boolean |
isQualifier(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Returns true if given type is a qualifier, false otherwise.
|
boolean |
isScope(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Returns true if given type is a scope type, false otherwise.
|
boolean |
isStereotype(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Returns true if given type is a stereotype type, false otherwise.
|
<X> Bean<? extends X> |
resolve(java.util.Set<Bean<? extends X>> beans)
Returns a bean object that is resolved according to the type safe resolution rules.
|
java.util.List<Decorator<?>> |
resolveDecorators(java.util.Set<java.lang.reflect.Type> types,
java.lang.annotation.Annotation... qualifiers)
Returns a list of decorator.
|
java.util.List<Interceptor<?>> |
resolveInterceptors(InterceptionType type,
java.lang.annotation.Annotation... interceptorBindings)
Returns a list of interceptor.
|
<T> java.util.Set<ObserverMethod<? super T>> |
resolveObserverMethods(T event,
java.lang.annotation.Annotation... qualifiers)
Returns set of observer methods.
|
void |
validate(InjectionPoint injectionPoint)
Validates injection point.
|
javax.el.ExpressionFactory |
wrapExpressionFactory(javax.el.ExpressionFactory expressionFactory)
Wrapped around given expression factory.
|
java.lang.Object getReference(Bean<?> bean, java.lang.reflect.Type beanType, CreationalContext<?> ctx)
bean - bean that its reference is gettingbeanType - bean api type that is implemented by the proxyctx - creational context is used to destroy any object with scope @Dependentjava.lang.IllegalArgumentException - if given bean type is not api type of the given bean objectjava.lang.Object getInjectableReference(InjectionPoint injectionPoint, CreationalContext<?> ctx)
injectionPoint - injection point definitionctx - creational context that is passed to the Contextual.create(CreationalContext) methodUnsatisfiedResolutionException - if no bean found for the given injection pointAmbiguousResolutionException - if more than one bean found<T> CreationalContext<T> createCreationalContext(Contextual<T> contextual)
java.util.Set<Bean<?>> getBeans(java.lang.reflect.Type beanType, java.lang.annotation.Annotation... qualifiers)
If no qualifier is given, @Current is assumed.
beanType - required bean typequalifiers - required qualifiersjava.lang.IllegalArgumentException - given bean type is a TypeVariablejava.lang.IllegalArgumentException - given qualifier annotation is not a qualifierjava.lang.IllegalArgumentException - same qualifier is givenjava.util.Set<Bean<?>> getBeans(java.lang.String name)
name - name of the beanBean<?> getPassivationCapableBean(java.lang.String id)
id - bean id<X> Bean<? extends X> resolve(java.util.Set<Bean<? extends X>> beans)
X - bean class infobeans - set of beansAmbiguousResolutionException - if ambigious existsvoid fireEvent(java.lang.Object event,
java.lang.annotation.Annotation... qualifiers)
event - observer event objectqualifiers - event qualifiersjava.lang.IllegalArgumentException - event object contains a TypeVariablejava.lang.IllegalArgumentException - given qualifier annotation is not a qualifierjava.lang.IllegalArgumentException - same qualifier is given<T> java.util.Set<ObserverMethod<? super T>> resolveObserverMethods(T event, java.lang.annotation.Annotation... qualifiers)
T - event typeevent - even objectqualifiers - event qualifiersjava.util.List<Decorator<?>> resolveDecorators(java.util.Set<java.lang.reflect.Type> types, java.lang.annotation.Annotation... qualifiers)
types - bean types of the decorated beanqualifiers - decorated bean qualifiersjava.lang.IllegalArgumentException - given qualifier annotation is not a qualifierjava.lang.IllegalArgumentException - same qualifier is givenjava.lang.IllegalArgumentException - if types is empty setjava.util.List<Interceptor<?>> resolveInterceptors(InterceptionType type, java.lang.annotation.Annotation... interceptorBindings)
type - interception typeinterceptorBindings - interceptor bindingsjava.lang.IllegalArgumentException - given binding annotation is not a bindingjava.lang.IllegalArgumentException - same binding is givenjava.lang.IllegalArgumentException - binding is not an interceptor bindingvoid validate(InjectionPoint injectionPoint)
injectionPoint - injection pointInjectionException - if problem existboolean isScope(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
annotationType - annotation typeboolean isNormalScope(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
annotationType - annotation typeboolean isPassivatingScope(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
annotationType - annotation typeboolean isQualifier(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
annotationType - annotation typeboolean isInterceptorBinding(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
annotationType - annotation typeboolean isStereotype(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
annotationType - annotation typejava.util.Set<java.lang.annotation.Annotation> getInterceptorBindingDefinition(java.lang.Class<? extends java.lang.annotation.Annotation> qualifier)
qualifier - binding classjava.util.Set<java.lang.annotation.Annotation> getStereotypeDefinition(java.lang.Class<? extends java.lang.annotation.Annotation> stereotype)
stereotype - stereotype type classContext getContext(java.lang.Class<? extends java.lang.annotation.Annotation> scope)
scope - scope type class typejavax.el.ELResolver getELResolver()
<T> AnnotatedType<T> createAnnotatedType(java.lang.Class<T> type)
AnnotatedType instance for the given
class.T - class typetype - classAnnotatedType instance<T> InjectionTarget<T> createInjectionTarget(AnnotatedType<T> type)
T - bean typetype - annotated typejavax.el.ExpressionFactory wrapExpressionFactory(javax.el.ExpressionFactory expressionFactory)
expressionFactory - expression factory