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(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(Object event,
Annotation... qualifiers)
Fires an event with given even object and qualifiers.
|
Set<Bean<?>> |
getBeans(String name)
Returns set of beans with given name.
|
Set<Bean<?>> |
getBeans(Type beanType,
Annotation... qualifiers)
Returns set of beans that their api types contain
given bean type and given qualifiers.
|
Context |
getContext(Class<? extends Annotation> scope)
Returns a context with given scope type.
|
javax.el.ELResolver |
getELResolver()
Returns el resolver.
|
Object |
getInjectableReference(InjectionPoint injectionPoint,
CreationalContext<?> ctx)
Gets injection point bean reference.
|
Set<Annotation> |
getInterceptorBindingDefinition(Class<? extends Annotation> qualifier)
Returns a set of meta-annotations that are defined on the binding
|
Bean<?> |
getPassivationCapableBean(String id)
Returns passivation capable bean given id.
|
Object |
getReference(Bean<?> bean,
Type beanType,
CreationalContext<?> ctx)
Returns a bean instance reference for the given bean.
|
Set<Annotation> |
getStereotypeDefinition(Class<? extends Annotation> stereotype)
Returns a set of meta-annotations that are defined on the stereotype type.
|
boolean |
isInterceptorBinding(Class<? extends Annotation> annotationType)
Returns true if given type is a interceptor binding, false otherwise.
|
boolean |
isNormalScope(Class<? extends Annotation> annotationType)
Returns true if given type is a normal scope type, false otherwise.
|
boolean |
isPassivatingScope(Class<? extends Annotation> annotationType)
Returns true if given type is a passivating scope type, false otherwise.
|
boolean |
isQualifier(Class<? extends Annotation> annotationType)
Returns true if given type is a qualifier, false otherwise.
|
boolean |
isScope(Class<? extends Annotation> annotationType)
Returns true if given type is a scope type, false otherwise.
|
boolean |
isStereotype(Class<? extends Annotation> annotationType)
Returns true if given type is a stereotype type, false otherwise.
|
<X> Bean<? extends X> |
resolve(Set<Bean<? extends X>> beans)
Returns a bean object that is resolved according to the type safe resolution rules.
|
List<Decorator<?>> |
resolveDecorators(Set<Type> types,
Annotation... qualifiers)
Returns a list of decorator.
|
List<Interceptor<?>> |
resolveInterceptors(InterceptionType type,
Annotation... interceptorBindings)
Returns a list of interceptor.
|
<T> Set<ObserverMethod<? super T>> |
resolveObserverMethods(T event,
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.
|
Object getReference(Bean<?> bean, 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 @DependentIllegalArgumentException - if given bean type is not api type of the given bean objectObject 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)
Set<Bean<?>> getBeans(Type beanType, Annotation... qualifiers)
If no qualifier is given, @Current is assumed.
beanType - required bean typequalifiers - required qualifiersIllegalArgumentException - given bean type is a TypeVariableIllegalArgumentException - given qualifier annotation is not a qualifierIllegalArgumentException - same qualifier is givenSet<Bean<?>> getBeans(String name)
name - name of the beanBean<?> getPassivationCapableBean(String id)
id - bean id<X> Bean<? extends X> resolve(Set<Bean<? extends X>> beans)
X - bean class infobeans - set of beansAmbiguousResolutionException - if ambigious existsvoid fireEvent(Object event, Annotation... qualifiers)
event - observer event objectqualifiers - event qualifiersIllegalArgumentException - event object contains a TypeVariableIllegalArgumentException - given qualifier annotation is not a qualifierIllegalArgumentException - same qualifier is given<T> Set<ObserverMethod<? super T>> resolveObserverMethods(T event, Annotation... qualifiers)
T - event typeevent - even objectqualifiers - event qualifiersList<Decorator<?>> resolveDecorators(Set<Type> types, Annotation... qualifiers)
types - bean types of the decorated beanqualifiers - decorated bean qualifiersIllegalArgumentException - given qualifier annotation is not a qualifierIllegalArgumentException - same qualifier is givenIllegalArgumentException - if types is empty setList<Interceptor<?>> resolveInterceptors(InterceptionType type, Annotation... interceptorBindings)
type - interception typeinterceptorBindings - interceptor bindingsIllegalArgumentException - given binding annotation is not a bindingIllegalArgumentException - same binding is givenIllegalArgumentException - binding is not an interceptor bindingvoid validate(InjectionPoint injectionPoint)
injectionPoint - injection pointInjectionException - if problem existboolean isScope(Class<? extends Annotation> annotationType)
annotationType - annotation typeboolean isNormalScope(Class<? extends Annotation> annotationType)
annotationType - annotation typeboolean isPassivatingScope(Class<? extends Annotation> annotationType)
annotationType - annotation typeboolean isQualifier(Class<? extends Annotation> annotationType)
annotationType - annotation typeboolean isInterceptorBinding(Class<? extends Annotation> annotationType)
annotationType - annotation typeboolean isStereotype(Class<? extends Annotation> annotationType)
annotationType - annotation typeSet<Annotation> getInterceptorBindingDefinition(Class<? extends Annotation> qualifier)
qualifier - binding classSet<Annotation> getStereotypeDefinition(Class<? extends Annotation> stereotype)
stereotype - stereotype type classContext getContext(Class<? extends Annotation> scope)
scope - scope type class typejavax.el.ELResolver getELResolver()
<T> AnnotatedType<T> createAnnotatedType(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 factoryCopyright © 2025. All rights reserved.