|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Manager
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 | ||
---|---|---|
Manager |
addBean(Bean<?> bean)
Allows a new bean to be registered. |
|
Manager |
addContext(Context context)
Associate a custom Context with a scope. |
|
Manager |
addDecorator(Decorator decorator)
Allows a new decorator to be registered. |
|
Manager |
addInterceptor(Interceptor interceptor)
Allows a new interceptor to be registered. |
|
|
addObserver(Observer<T> observer,
java.lang.Class<T> eventType,
java.lang.annotation.Annotation... bindings)
Register an observer with the container |
|
|
addObserver(Observer<T> observer,
TypeLiteral<T> eventType,
java.lang.annotation.Annotation... bindings)
Register an observer with the container |
|
Manager |
createActivity()
Create a new child activity. |
|
void |
fireEvent(java.lang.Object event,
java.lang.annotation.Annotation... bindings)
Fire an event |
|
Context |
getContext(java.lang.Class<? extends java.lang.annotation.Annotation> scopeType)
Obtain an active context instance for the given scope type. |
|
|
getInstance(Bean<T> bean)
Obtains an instance of a bean |
|
java.lang.Object |
getInstanceByName(java.lang.String name)
Obtains an instance of a bean by considering the bean name and deployment precedence. |
|
|
getInstanceByType(java.lang.Class<T> type,
java.lang.annotation.Annotation... bindings)
Obtains an instance of a bean by considering bean type, bindings, and deployment precedence. |
|
|
getInstanceByType(TypeLiteral<T> type,
java.lang.annotation.Annotation... bindings)
Obtains an instance of a bean by considering bean type, bindings, and deployment precedence. |
|
|
getInstanceToInject(InjectionPoint injectionPoint)
Obtains an instance of bean for a given injection point. |
|
|
getInstanceToInject(InjectionPoint injectionPoint,
CreationalContext<?> creationalContext)
Obtains an instance of bean for a given injection point. |
|
Manager |
parse(java.io.InputStream xmlStream)
Allows additional XML based to be provided. |
|
|
removeObserver(Observer<T> observer,
java.lang.Class<T> eventType,
java.lang.annotation.Annotation... bindings)
Remove an observer registration |
|
|
removeObserver(Observer<T> observer,
TypeLiteral<T> eventType,
java.lang.annotation.Annotation... bindings)
Remove an observer registration |
|
java.util.Set<Bean<?>> |
resolveByName(java.lang.String name)
Allows beans to be matched by considering the bean name and deployment precedence. |
|
|
resolveByType(java.lang.Class<T> type,
java.lang.annotation.Annotation... bindings)
Allows beans to be matched to injection point by considering bean type, bindings, and deployment precedence. |
|
|
resolveByType(TypeLiteral<T> type,
java.lang.annotation.Annotation... bindings)
Allows beans to be matched to injection point by considering bean type, bindings, and deployment precedence. |
|
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 |
|
|
resolveObservers(T event,
java.lang.annotation.Annotation... bindings)
Obtains observers for an event by considering event type and bindings. |
|
Manager |
setCurrent(java.lang.Class<? extends java.lang.annotation.Annotation> scopeType)
Associate an activity with the current context for a normal scope |
Method Detail |
---|
<T> java.util.Set<Bean<T>> resolveByType(java.lang.Class<T> type, java.lang.annotation.Annotation... bindings)
T
- the type of the beans to be resolvedtype
- the type of the beans to be resolvedbindings
- the bindings used to restrict the matched beans
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 binding type is passed
DuplicateBindingTypeException
- if two instances of the same binding type are passed<T> java.util.Set<Bean<T>> resolveByType(TypeLiteral<T> type, java.lang.annotation.Annotation... bindings)
T
- the type of the beans to be resolvedtype
- the type of the beans to be resolvedbindings
- the bindings used to restrict the matched beans
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 binding type is passed
DuplicateBindingTypeException
- if two instances of the same binding type are passed<T> T getInstanceByType(java.lang.Class<T> type, java.lang.annotation.Annotation... bindings)
T
- the type of the bean to obtaintype
- the type of the bean to obtainbindings
- the bindings used to restrict the matched beans
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 binding type is passed
DuplicateBindingTypeException
- if two instances of the same binding type are passed
UnsatisfiedDependencyException
- if no bean can be resolved for the given type and bindings
AmbiguousDependencyException
- if more than one bean is resolved for the given type and
bindings<T> T getInstanceByType(TypeLiteral<T> type, java.lang.annotation.Annotation... bindings)
T
- the type of the bean to obtaintype
- the type of the bean to obtainbindings
- the bindings used to restrict the matched beans
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 binding type is passed
DuplicateBindingTypeException
- if two instances of the same binding type are passed
UnsatisfiedDependencyException
- if no bean can be resolved for the given type and bindings
AmbiguousDependencyException
- if more than one bean is resolved for the given type and
bindingsjava.util.Set<Bean<?>> resolveByName(java.lang.String name)
name
- the name used to restrict the beans matched
java.lang.Object getInstanceByName(java.lang.String name)
name
- the name used to restrict the beans matched
AmbiguousDependencyException
- if more than one bean matches<T> T getInstance(Bean<T> bean)
T
- the type of the beanbean
- the bean to obtain an instance of
<T> T getInstanceToInject(InjectionPoint injectionPoint, CreationalContext<?> creationalContext)
T
- the type of the beaninjectionPoint
- the injection point the instance is needed forcreationalContext
- the context in which the injection is occurring
UnsatisfiedDependencyException
- if no bean can be resolved for the given type and bindings
AmbiguousDependencyException
- if more than one bean is resolved for the given type and
bindings<T> T getInstanceToInject(InjectionPoint injectionPoint)
T
- the type of the beaninjectionPoint
- the injection point the instance is needed for
UnsatisfiedDependencyException
- if no bean can be resolved for the given type and bindings
AmbiguousDependencyException
- if more than one bean is resolved for the given type and
bindingsvoid 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 a parameterized type with a type parameter or a wildcard is
passedContext 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 typeManager addContext(Context context)
context
- the context to register
Manager addBean(Bean<?> bean)
bean
- the bean to register
Manager addInterceptor(Interceptor interceptor)
interceptor
- the interceptor to register
Manager addDecorator(Decorator decorator)
decorator
- the decorator to register
Manager parse(java.io.InputStream xmlStream)
xmlStream
- the XML metadata
Manager createActivity()
Manager setCurrent(java.lang.Class<? extends java.lang.annotation.Annotation> scopeType)
scopeType
- the scope to associate the activity with
ContextNotActiveException
- if the given scope is inactive
java.lang.IllegalArgumentException
- if the given scope is not a normal scope<T> Manager addObserver(Observer<T> observer, java.lang.Class<T> eventType, java.lang.annotation.Annotation... bindings)
T
- the type of the observerobserver
- the observer to registereventType
- the event type the observer observesbindings
- event bindings to further restrict the events observed
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 binding type is passed
DuplicateBindingTypeException
- if two instances of the same binding type are passed<T> Manager addObserver(Observer<T> observer, TypeLiteral<T> eventType, java.lang.annotation.Annotation... bindings)
T
- the type of the observerobserver
- the observer to registereventType
- the event type the observer observesbindings
- event bindings to further restrict the events observed
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
DuplicateBindingTypeException
- if two instances of the same binding type are passed<T> Manager removeObserver(Observer<T> observer, java.lang.Class<T> eventType, java.lang.annotation.Annotation... bindings)
T
- the type of the observerobserver
- the observer to registereventType
- the event type the observer obseresbindings
- event bindings to further restrict the events observed
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
DuplicateBindingTypeException
- if two instances of the same binding type are passed<T> Manager removeObserver(Observer<T> observer, TypeLiteral<T> eventType, java.lang.annotation.Annotation... bindings)
T
- the type of the observerobserver
- the observer to registereventType
- the event type the observer obseresbindings
- event bindings to further restrict the events observed
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
DuplicateBindingTypeException
- if two instances of the same binding type are passed<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
DuplicateBindingTypeException
- 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
DuplicateBindingTypeException
- 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
DuplicateBindingTypeException
- if two instances of the same binding type are passed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |