|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface BeanManager
The contract between the application and the manager. Also the contract between the manager and Bean, Context and Observer objects. The application should not normally need to call this interface.
Method Summary | ||
---|---|---|
void |
addBean(Bean<?> bean)
Deprecated. |
|
void |
addContext(Context context)
Deprecated. |
|
void |
addObserver(Observer<?> observer,
java.lang.annotation.Annotation... bindings)
Deprecated. |
|
|
createAnnotatedType(java.lang.Class<T> type)
Get an AnnotatedType for the given class |
|
|
createCreationalContext(Contextual<T> contextual)
Obtain an instance of a CreationalContext for the given contextual |
|
|
createInjectionTarget(AnnotatedType<T> type)
Returns an InjectionTarget to allow injection into custom beans or non-contextual instances by portable extensions. |
|
void |
fireEvent(java.lang.Object event,
java.lang.annotation.Annotation... bindings)
Fire an event |
|
java.util.Set<Bean<?>> |
getBeans(java.lang.String name)
Returns the set of beans which match the given EL name and are accessible to the class into which the BeanManager was injected, according to the rules of EL name resolution. |
|
java.util.Set<Bean<?>> |
getBeans(java.lang.reflect.Type beanType,
java.lang.annotation.Annotation... bindings)
Returns the set of beans which match the given required type and bindings and are accessible to the class into which the BeanManager was injected, according to the rules of typesafe resolution. |
|
Context |
getContext(java.lang.Class<? extends java.lang.annotation.Annotation> scopeType)
Obtain an active context instance for the given scope type. |
|
javax.el.ELResolver |
getELResolver()
Returns the ELResolver for integration with the servlet engine and JSF implementation This resolver will return a contextual instance of a bean if the name for resolution resolves to exactly one bean |
|
java.util.List<java.lang.Class<? extends java.lang.annotation.Annotation>> |
getEnabledDeploymentTypes()
Deprecated. |
|
java.lang.Object |
getInjectableReference(InjectionPoint ij,
CreationalContext<?> ctx)
Obtains an instance of bean for a given injection point. |
|
java.util.Set<java.lang.annotation.Annotation> |
getInterceptorBindingTypeDefinition(java.lang.Class<? extends java.lang.annotation.Annotation> bindingType)
Obtain the set of interceptor binding types meta-annotatinos for the given binding type annotation |
|
|
getMostSpecializedBean(Bean<X> bean)
Returns the Bean object representing the most specialized enabled bean registered with the container that specializes the given bean, |
|
Bean<?> |
getPassivationCapableBean(java.lang.String id)
Returns the PassivationCapableBean with the given identifier. |
|
java.lang.Object |
getReference(Bean<?> bean,
java.lang.reflect.Type beanType,
CreationalContext<?> ctx)
Obtains a contextual reference for a given bean and a given bean type. |
|
ScopeType |
getScopeDefinition(java.lang.Class<? extends java.lang.annotation.Annotation> scopeType)
Return a ScopeType definition type for a given annotation representing a scope type |
|
java.util.Set<java.lang.annotation.Annotation> |
getStereotypeDefinition(java.lang.Class<? extends java.lang.annotation.Annotation> stereotype)
Obtain the set of binding types meta-annotations for the given stereotype annotation |
|
boolean |
isBindingType(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Determine if the given annotationType is a binding type |
|
boolean |
isInterceptorBindingType(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Determine if the given annotationType is an interceptor binding type |
|
boolean |
isScopeType(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Determine if the given annotationType is a scope type |
|
boolean |
isStereotype(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Determine if the given annotationType is a stereotype |
|
void |
removeObserver(Observer<?> observer)
Deprecated. |
|
|
resolve(java.util.Set<Bean<? extends X>> beans)
Apply the ambiguous dependency resolution rules |
|
java.util.List<Decorator<?>> |
resolveDecorators(java.util.Set<java.lang.reflect.Type> types,
java.lang.annotation.Annotation... bindings)
Obtains an ordered list of enabled decorators for a set of bean types and a set of bindings |
|
java.util.List<Interceptor<?>> |
resolveInterceptors(InterceptionType type,
java.lang.annotation.Annotation... interceptorBindings)
Obtains an ordered list of enabled interceptors for a set interceptor bindings |
|
|
resolveObserverMethods(T event,
java.lang.annotation.Annotation... bindings)
Obtains observers for an event by considering event type and bindings. |
|
|
resolveObservers(T event,
java.lang.annotation.Annotation... bindings)
Deprecated. |
|
void |
validate(InjectionPoint injectionPoint)
Validates the dependency |
Method Detail |
---|
java.lang.Object getReference(Bean<?> bean, java.lang.reflect.Type beanType, CreationalContext<?> ctx)
bean
- the Bean object representing the beanbeanType
- a bean type that must be implemented by any proxy that is
returned
java.lang.IllegalArgumentException
- if the given type is not a bean type of
the given beanjava.lang.Object getInjectableReference(InjectionPoint ij, CreationalContext<?> ctx)
ij
- the injection point the instance is needed forctx
- the context in which the injection is occurring
UnsatisfiedResolutionException
- if no bean can be resolved for the
given type and bindings
AmbiguousResolutionException
- if more than one bean is resolved for
the given type and bindings<T> CreationalContext<T> createCreationalContext(Contextual<T> contextual)
CreationalContext
for the given contextual
contextual
- the contextual to create a creational context for
CreationalContext
instancejava.util.Set<Bean<?>> getBeans(java.lang.reflect.Type beanType, java.lang.annotation.Annotation... bindings)
beanType
- the type of the beans to be resolvedbindings
- the bindings used to restrict the matched beans. If no
bindings are passed to getBeans(), the default binding @Current
is assumed.
java.lang.IllegalArgumentException
- if the given type represents a type
variable
java.lang.IllegalArgumentException
- if two instances of the same binding type
are
java.lang.IllegalArgumentException
- if an instance of an annotation that is
not a binding type is givenjava.util.Set<Bean<?>> getBeans(java.lang.String name)
name
- the name used to restrict the beans matched
<X> Bean<? extends X> getMostSpecializedBean(Bean<X> bean)
X
- The type of the beanbean
- The Bean representation of the bean.
Bean<?> getPassivationCapableBean(java.lang.String id)
<X> Bean<? extends X> resolve(java.util.Set<Bean<? extends X>> beans)
X
- The type of the beanbeans
- A set of beans of the given type
AmbiguousResolutionException
- if the ambiguous dependency
resolution rules failvoid validate(InjectionPoint injectionPoint)
injectionPoint
- the injection point to validate
an
- InjectionException if there is a deployment problem (for
example, an unsatisfied or unresolvable ambiguous dependency)
associated with the injection point.void fireEvent(java.lang.Object event, java.lang.annotation.Annotation... bindings)
event
- the event objectbindings
- the event bindings used to restrict the observers matched
java.lang.IllegalArgumentException
- if the runtime type of the event object
contains a type variable
java.lang.IllegalArgumentException
- if two instances of the same binding type
are given
java.lang.IllegalArgumentException
- if an instance of an annotation that is
not a binding type is given,@Deprecated <T> java.util.Set<Observer<T>> resolveObservers(T event, java.lang.annotation.Annotation... bindings)
T
- the type of the event to obtainevent
- the event objectbindings
- the bindings used to restrict the matched observers
java.lang.IllegalArgumentException
- if a parameterized type with a type
parameter or a wildcard is passed
java.lang.IllegalArgumentException
- if an annotation which is not a event
binding type is passed
java.lang.IllegalArgumentException
- if two instances of the same binding type
are passed<T> java.util.Set<ObserverMethod<T,?>> resolveObserverMethods(T event, java.lang.annotation.Annotation... bindings)
T
- the type of the event to obtainevent
- the event objectbindings
- the bindings used to restrict the matched observers
java.lang.IllegalArgumentException
- if a parameterized type with a type
parameter or a wildcard is passed
java.lang.IllegalArgumentException
- if an annotation which is not a event
binding type is passed
java.lang.IllegalArgumentException
- if two instances of the same binding type
are passedjava.util.List<Decorator<?>> resolveDecorators(java.util.Set<java.lang.reflect.Type> types, java.lang.annotation.Annotation... bindings)
types
- the set of bean types of the decorated beanbindings
- the bindings declared by the decorated bean
java.lang.IllegalArgumentException
- if the set of bean types is empty
java.lang.IllegalArgumentException
- if an annotation which is not a binding
type is passed
java.lang.IllegalArgumentException
- if two instances of the same binding type
are passedjava.util.List<Interceptor<?>> resolveInterceptors(InterceptionType type, java.lang.annotation.Annotation... interceptorBindings)
type
- the type of the interceptionbindings
- the bindings used to restrict the matched interceptors
java.lang.IllegalArgumentException
- if no interceptor binding type is passed
java.lang.IllegalArgumentException
- if an annotation which is not a
interceptor binding type is passed
java.lang.IllegalArgumentException
- if two instances of the same binding type
are passedboolean isScopeType(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
boolean isBindingType(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
boolean isInterceptorBindingType(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
boolean isStereotype(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
ScopeType getScopeDefinition(java.lang.Class<? extends java.lang.annotation.Annotation> scopeType)
java.util.Set<java.lang.annotation.Annotation> getInterceptorBindingTypeDefinition(java.lang.Class<? extends java.lang.annotation.Annotation> bindingType)
java.util.Set<java.lang.annotation.Annotation> getStereotypeDefinition(java.lang.Class<? extends java.lang.annotation.Annotation> stereotype)
Context getContext(java.lang.Class<? extends java.lang.annotation.Annotation> scopeType)
scopeType
- the scope to get the context instance for
ContextNotActiveException
- if no active contexts exist for the
given scope type
java.lang.IllegalArgumentException
- if more than one active context exists
for the given scope typejavax.el.ELResolver getELResolver()
<T> AnnotatedType<T> createAnnotatedType(java.lang.Class<T> type)
AnnotatedType
for the given class
T
- the typetype
- the type
AnnotatedType
<T> InjectionTarget<T> createInjectionTarget(AnnotatedType<T> type)
T
- The type of the AnnotatedType to inspecttype
- The AnnotatedType to inspect
java.lang.IllegalArgumentException
- if there is a definition error associated
with any injection point of the type.@Deprecated void addBean(Bean<?> bean)
bean
- the bean to register@Deprecated void addObserver(Observer<?> observer, java.lang.annotation.Annotation... bindings)
observer
- the observer to registerbindings
- event bindings to further restrict the events observed
passed
java.lang.IllegalArgumentException
- if an annotation which is not a binding
type is passed, or if two instances of the same binding type
are passed, or if the runtime type of the observer object
contains a type variable@Deprecated void removeObserver(Observer<?> observer)
observer
- the observer to register
java.lang.IllegalArgumentException
- if an annotation which is not a event
binding type is passed or if two instances of the same binding
type are passed@Deprecated java.util.List<java.lang.Class<? extends java.lang.annotation.Annotation>> getEnabledDeploymentTypes()
@Deprecated void addContext(Context context)
context
- the context to register
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |