Represents an observer method of an enabled bean. Defines everything the container needs to know about an observer method.
If a custom implementation of this interface does not override either notify(Object) or
notify(EventContext), the container automatically detects the problem and treats it as a definition error.
| Modifier and Type | Field and Description |
|---|---|
| public static final int |
| Modifier and Type | Method and Description |
|---|---|
| public Class | Returns: the defining classObtains the class of the type that declares the observer method. |
| public default Bean | |
| public Set | Returns: the observed event qualifiersObtains the set of observed event qualifiers. |
| public Type | |
| public default int | Returns: The priority that will be used by the container to determine the notification order in which event observer methods are invoked.Implements jakarta. |
| public Reception | |
| public TransactionPhase | Returns: theTransactionPhaseObtains the specified |
| public default boolean | Returns: returnstrue if the method is an asynchronous observer method (i.e. defined with ObservesAsync),
otherwise returns falseDetermines if this observer method is asynchronous |
| public default void | |
| public default void | notify(EventContext<T>
EventContext used to notify observersCalls the observer method, passing the given event context. |
| DEFAULT_PRIORITY | back to summary |
|---|---|
| public static final int DEFAULT_PRIORITY | |
| getBeanClass | back to summary |
|---|---|
| public Class Obtains the class of the type that declares the observer method. | |
| getDeclaringBean | back to summary |
|---|---|
| public default Bean Obtains the bean that declares the observer method. For synthetic observers, the return value is undefined.
For the sake of compatibility with existing custom | |
| getObservedQualifiers | back to summary |
|---|---|
| public Set Obtains the set of observed event qualifiers.
| |
| getObservedType | back to summary |
|---|---|
| public Type getObservedType() Obtains the observed event type. | |
| getPriority | back to summary |
|---|---|
| public default int getPriority() Implements jakarta. The priority that will be used by the container to determine the notification order in which event observer methods are invoked.
| |
| getReception | back to summary |
|---|---|
| public Reception getReception() Obtains the specified | |
| getTransactionPhase | back to summary |
|---|---|
| public TransactionPhase getTransactionPhase() Obtains the specified
| |
| isAsync | back to summary |
|---|---|
| public default boolean isAsync() Determines if this observer method is asynchronous
| |
| notify | back to summary |
|---|---|
| public default void notify(T event) Calls the observer method, passing the given event object.
The implementation of this method for a custom observer method is responsible for deciding whether to call
the method if the
| |
| notify | back to summary |
|---|---|
| public default void notify(EventContext<T> eventContext) Calls the observer method, passing the given event context.
The container should always call this method, but the default implementation delegates to
The implementation of this method for a custom observer method is responsible for deciding whether to call the method if
the
| |