Package javax.enterprise.inject.spi
Interface ObserverMethod<T>
- Type Parameters:
T
- the event type
public interface ObserverMethod<T>
Represents an observer method of an enabled bean. Defines everything the container needs to know about an observer method.
-
Method Summary
Modifier and TypeMethodDescriptionClass<?>
Obtains the class of the type that declares the observer method.Obtains the set of observed event qualifiers.Obtains the observed event type.Obtains the specifiedReception
for the observer method.Obtains the specifiedTransactionPhase
for the observer method.void
Calls the observer method, passing the given event object.
-
Method Details
-
getBeanClass
Class<?> getBeanClass()Obtains the class of the type that declares the observer method.
- Returns:
- the defining class
-
getObservedType
Type getObservedType()Obtains the observed event type.- Returns:
- the observed event type
-
getObservedQualifiers
Set<Annotation> getObservedQualifiers()Obtains the set of observed event qualifiers.- Returns:
- the observed event qualifiers
-
getReception
Reception getReception()Obtains the specifiedReception
for the observer method. This indicates if the observer is conditional or not.- Returns:
- the
Reception
-
getTransactionPhase
TransactionPhase getTransactionPhase()Obtains the specifiedTransactionPhase
for the observer method.- Returns:
- the
TransactionPhase
-
notify
Calls the observer method, passing the given event object.
The implementation of
notify(Object)
for a custom observer method is responsible for deciding whether to call the method if thegetReception()
returnsReception.IF_EXISTS
.- Parameters:
event
- the event object
-