|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface BeanManager
The interface 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.
Method Summary | ||
---|---|---|
|
createAnnotatedType(Class<T> type)
Returns a AnnotatedType instance for the given
class. |
|
|
createCreationalContext(Contextual<T> contextual)
Returns a new creational context implementation. |
|
|
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. |
|
|
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. |
|
|
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. |
Method Detail |
---|
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 @Dependent
IllegalArgumentException
- 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)
method
UnsatisfiedResolutionException
- if no bean found for the given injection point
AmbiguousResolutionException
- 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 qualifiers
IllegalArgumentException
- given bean type is a TypeVariable
IllegalArgumentException
- given qualifier annotation is not a qualifier
IllegalArgumentException
- same qualifier is givenSet<Bean<?>> getBeans(String name)
name
- name of the bean
Bean<?> getPassivationCapableBean(String id)
id
- bean id
<X> Bean<? extends X> resolve(Set<Bean<? extends X>> beans)
X
- bean class infobeans
- set of beans
AmbiguousResolutionException
- if ambigious existsvoid fireEvent(Object event, Annotation... qualifiers)
event
- observer event objectqualifiers
- event qualifiers
IllegalArgumentException
- event object contains a TypeVariable
IllegalArgumentException
- given qualifier annotation is not a qualifier
IllegalArgumentException
- same qualifier is given<T> Set<ObserverMethod<? super T>> resolveObserverMethods(T event, Annotation... qualifiers)
T
- event typeevent
- even objectqualifiers
- event qualifiers
List<Decorator<?>> resolveDecorators(Set<Type> types, Annotation... qualifiers)
types
- bean types of the decorated beanqualifiers
- decorated bean qualifiers
IllegalArgumentException
- given qualifier annotation is not a qualifier
IllegalArgumentException
- same qualifier is given
IllegalArgumentException
- if types is empty setList<Interceptor<?>> resolveInterceptors(InterceptionType type, Annotation... interceptorBindings)
type
- interception typeinterceptorBindings
- interceptor bindings
IllegalArgumentException
- given binding annotation is not a binding
IllegalArgumentException
- same binding is given
IllegalArgumentException
- binding is not an interceptor bindingvoid validate(InjectionPoint injectionPoint)
injectionPoint
- injection point
InjectionException
- if problem existboolean isScope(Class<? extends Annotation> annotationType)
annotationType
- annotation type
boolean isNormalScope(Class<? extends Annotation> annotationType)
annotationType
- annotation type
boolean isPassivatingScope(Class<? extends Annotation> annotationType)
annotationType
- annotation type
boolean isQualifier(Class<? extends Annotation> annotationType)
annotationType
- annotation type
boolean isInterceptorBinding(Class<? extends Annotation> annotationType)
annotationType
- annotation type
boolean isStereotype(Class<? extends Annotation> annotationType)
annotationType
- annotation type
Set<Annotation> getInterceptorBindingDefinition(Class<? extends Annotation> qualifier)
qualifier
- binding class
Set<Annotation> getStereotypeDefinition(Class<? extends Annotation> stereotype)
stereotype
- stereotype type class
Context getContext(Class<? extends Annotation> scope)
scope
- scope type class type
javax.el.ELResolver getELResolver()
<T> AnnotatedType<T> createAnnotatedType(Class<T> type)
AnnotatedType
instance for the given
class.
T
- class typetype
- class
AnnotatedType
instance<T> InjectionTarget<T> createInjectionTarget(AnnotatedType<T> type)
T
- bean typetype
- annotated type
javax.el.ExpressionFactory wrapExpressionFactory(javax.el.ExpressionFactory expressionFactory)
expressionFactory
- expression factory
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |