Top Description Methods
jakarta.enterprise.inject.build.compatible.spi

public Interface ObserverInfo

Imports
jakarta.enterprise.lang.model.AnnotationInfo, jakarta.enterprise.lang.model.declarations.ClassInfo, .MethodInfo, .ParameterInfo, jakarta.enterprise.lang.model.types.Type, java.util.Collection, jakarta.enterprise.event.Reception, .TransactionPhase

Observers are: Observer methods directly correspond to a method declaration in program source code. Synthetic observers don't and are instead defined through other mechanisms, such as extensions.
Since
4.0

Method Summary

Modifier and TypeMethod and Description
public BeanInfo

Returns:

the bean declaring this observer method, or null if this is a synthetic observer
bean
()

Returns the bean that declares this observer method.

public ClassInfo

Returns:

the class that declares this observer, never null
declaringClass
()

Returns the class that declares this observer.

public ParameterInfo

Returns:

the event parameter of this observer method, or null if this is a synthetic observer
eventParameter
()

Returns the event parameter of this observer method.

public Type

Returns:

the observed event type of this observer, never null
eventType
()

Returns the observed event type of this observer.

public boolean

Returns:

whether this observer is asynchronous
isAsync
()

Returns whether this observer is asynchronous.

public boolean

Returns:

whether this observer is synthetic
isSynthetic
()

Returns whether this observer is synthetic.

public MethodInfo

Returns:

this observer method, or null if this is a synthetic observer
observerMethod
()

Returns the declaration of this observer method.

public int

Returns:

the priority of this observer
priority
()

Returns the priority of this observer.

public Collection<AnnotationInfo>

Returns:

immutable collection of observed event qualifiers, never null
qualifiers
()

Returns a collection of observed event qualifiers, represented as AnnotationInfo.

public Reception

Returns:

the reception type of this observer, never null
reception
()

Returns the reception type of this observer.

public TransactionPhase

Returns:

the transaction phase of this observer, or null if this is an asynchronous observer
transactionPhase
()

Returns the transaction phase of this transactional observer.

Method Detail

beanback to summary
public BeanInfo bean()

Returns the bean that declares this observer method. Returns null if this is a synthetic observer.

Returns:BeanInfo

the bean declaring this observer method, or null if this is a synthetic observer

declaringClassback to summary
public ClassInfo declaringClass()

Returns the class that declares this observer. In case of synthetic observers, returns the class that was designated as a declaring class during synthetic observer registration.

Returns:ClassInfo

the class that declares this observer, never null

eventParameterback to summary
public ParameterInfo eventParameter()

Returns the event parameter of this observer method. Returns null if this is a synthetic observer.

Returns:ParameterInfo

the event parameter of this observer method, or null if this is a synthetic observer

eventTypeback to summary
public Type eventType()

Returns the observed event type of this observer.

Returns:Type

the observed event type of this observer, never null

isAsyncback to summary
public boolean isAsync()

Returns whether this observer is asynchronous. For observer methods, this means whether this observer method uses @ObservesAsync.

Returns:boolean

whether this observer is asynchronous

isSyntheticback to summary
public boolean isSynthetic()

Returns whether this observer is synthetic.

Returns:boolean

whether this observer is synthetic

observerMethodback to summary
public MethodInfo observerMethod()

Returns the declaration of this observer method. Returns null if this is a synthetic observer.

Returns:MethodInfo

this observer method, or null if this is a synthetic observer

priorityback to summary
public int priority()

Returns the priority of this observer. This is typically defined by adding the @Priority annotation to the event parameter of the observer method. If the annotation is not used, the default priority, as defined by the CDI specification, is returned,

Returns:int

the priority of this observer

qualifiersback to summary
public Collection<AnnotationInfo> qualifiers()

Returns a collection of observed event qualifiers, represented as AnnotationInfo.

Returns:Collection<AnnotationInfo>

immutable collection of observed event qualifiers, never null

receptionback to summary
public Reception reception()

Returns the reception type of this observer. Allows distinguishing conditional observer methods from always notified observer methods. Returns Reception#ALWAYS if this is a synthetic observer.

Returns:Reception

the reception type of this observer, never null

transactionPhaseback to summary
public TransactionPhase transactionPhase()

Returns the transaction phase of this transactional observer. Returns TransactionPhase#IN_PROGRESS if this is a regular synchronous observer. Returns null if this is an asynchronous observer.

Returns:TransactionPhase

the transaction phase of this observer, or null if this is an asynchronous observer