Interface ObserverMethodConfigurator<T>
-
- Type Parameters:
T
- type of the event the configured ObserverMethod will observe
public interface ObserverMethodConfigurator<T>
An
ObserverMethodConfigurator
can configure anObserverMethod
. The container must provide an implementation of this interface.This configurator is not thread safe and shall not be used concurrently.
CDI Lite implementations are not required to provide support for Portable Extensions.
- Since:
- 2.0
- Author:
- Antoine Sabot-Durand
- See Also:
ProcessObserverMethod.configureObserverMethod()
,AfterBeanDiscovery.addObserverMethod()
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
ObserverMethodConfigurator.EventConsumer<T>
Represents an operation that accepts a context of a fired event.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ObserverMethodConfigurator<T>
addQualifier(Annotation qualifier)
Add the qualifier to the observed eventObserverMethodConfigurator<T>
addQualifiers(Annotation... qualifiers)
Add all the qualifiers to the Observed eventObserverMethodConfigurator<T>
addQualifiers(Set<Annotation> qualifiers)
Add all the qualifiers to the Observed eventObserverMethodConfigurator<T>
async(boolean async)
Allows modification of the asynchronous status of the observer to build.ObserverMethodConfigurator<T>
beanClass(Class<?> type)
Set the class of the Bean containing this observer.ObserverMethodConfigurator<T>
notifyWith(ObserverMethodConfigurator.EventConsumer<T> callback)
Define an operation that accepts a context of a fired event.ObserverMethodConfigurator<T>
observedType(Type type)
Set the type of the observed eventObserverMethodConfigurator<T>
priority(int priority)
Set the priority for the observer to buildObserverMethodConfigurator<T>
qualifiers(Annotation... qualifiers)
Replace all qualifiers on the Observed event.ObserverMethodConfigurator<T>
qualifiers(Set<Annotation> qualifiers)
Replace all qualifiers on the Observed event.ObserverMethodConfigurator<T>
read(AnnotatedMethod<?> method)
Read observer meta data from a existingAnnotatedMethod
ObserverMethodConfigurator<T>
read(ObserverMethod<T> method)
Read observer meta data from a existing ObserverMethodObserverMethodConfigurator<T>
read(Method method)
Read observer meta data from a existingMethod
ObserverMethodConfigurator<T>
reception(Reception reception)
Set theReception
mode for the observer to buildObserverMethodConfigurator<T>
transactionPhase(TransactionPhase transactionPhase)
Set theTransactionPhase
for the observer to build
-
-
-
Method Detail
-
read
ObserverMethodConfigurator<T> read(Method method)
Read observer meta data from a existingMethod
- Parameters:
method
- to read meta data from- Returns:
- self
-
read
ObserverMethodConfigurator<T> read(AnnotatedMethod<?> method)
Read observer meta data from a existingAnnotatedMethod
- Parameters:
method
- to read meta data from- Returns:
- self
-
read
ObserverMethodConfigurator<T> read(ObserverMethod<T> method)
Read observer meta data from a existing ObserverMethod- Parameters:
method
- to read meta data from- Returns:
- self
-
beanClass
ObserverMethodConfigurator<T> beanClass(Class<?> type)
Set the class of the Bean containing this observer. If not set, the extension class is used.- Parameters:
type
- the bean class containing this configurator.- Returns:
- self
-
observedType
ObserverMethodConfigurator<T> observedType(Type type)
Set the type of the observed event- Parameters:
type
- of the observed event- Returns:
- self
-
addQualifier
ObserverMethodConfigurator<T> addQualifier(Annotation qualifier)
Add the qualifier to the observed event- Parameters:
qualifier
- to add to event- Returns:
- self
-
addQualifiers
ObserverMethodConfigurator<T> addQualifiers(Annotation... qualifiers)
Add all the qualifiers to the Observed event- Parameters:
qualifiers
- to add to event- Returns:
- self
-
addQualifiers
ObserverMethodConfigurator<T> addQualifiers(Set<Annotation> qualifiers)
Add all the qualifiers to the Observed event- Parameters:
qualifiers
- to add to event- Returns:
- self
-
qualifiers
ObserverMethodConfigurator<T> qualifiers(Annotation... qualifiers)
Replace all qualifiers on the Observed event.- Parameters:
qualifiers
- to put on event- Returns:
- self
-
qualifiers
ObserverMethodConfigurator<T> qualifiers(Set<Annotation> qualifiers)
Replace all qualifiers on the Observed event.- Parameters:
qualifiers
- to put on event- Returns:
- self
-
reception
ObserverMethodConfigurator<T> reception(Reception reception)
Set theReception
mode for the observer to build- Parameters:
reception
- reception type- Returns:
- self
-
transactionPhase
ObserverMethodConfigurator<T> transactionPhase(TransactionPhase transactionPhase)
Set theTransactionPhase
for the observer to build- Parameters:
transactionPhase
- phase for the observer- Returns:
- self
-
priority
ObserverMethodConfigurator<T> priority(int priority)
Set the priority for the observer to build- Parameters:
priority
- priority of the observer- Returns:
- self
-
notifyWith
ObserverMethodConfigurator<T> notifyWith(ObserverMethodConfigurator.EventConsumer<T> callback)
Define an operation that accepts a context of a fired event.- Parameters:
callback
- to call for the event notification- Returns:
- self
-
async
ObserverMethodConfigurator<T> async(boolean async)
Allows modification of the asynchronous status of the observer to build.- Parameters:
async
- async status- Returns:
- self
-
-