Top Description Inners Methods
javax.enterprise.inject.spi.configurator

public Interface ObserverMethodConfigurator<T>

Type Parameters
<T>
type of the event the configured ObserverMethod will observe
Imports
java.lang.annotation.Annotation, java.lang.reflect.Method, .Type, java.util.Set, javax.enterprise.event.ObserverException, .Reception, .TransactionPhase, javax.enterprise.inject.spi.AfterBeanDiscovery, .AnnotatedMethod, .EventContext, .ObserverMethod, .ProcessObserverMethod

An ObserverMethodConfigurator can configure an ObserverMethod. The container must provide an implementation of this interface.

This configurator is not thread safe and shall not be used concurrently.

Author
Antoine Sabot-Durand
Since
2.0
See Also
ProcessObserverMethod#configureObserverMethod(), AfterBeanDiscovery#addObserverMethod()

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
ObserverMethodConfigurator.EventConsumer<T>

Represents an operation that accepts a context of a fired event.

Method Summary

Modifier and TypeMethod and Description
public ObserverMethodConfigurator<T>

Returns:

self
addQualifier
(Annotation
to add to event
qualifier
)

Add the qualifier to the observed event

public ObserverMethodConfigurator<T>

Returns:

self
addQualifiers
(Annotation...
to add to event
qualifiers
)

Add all the qualifiers to the Observed event

public ObserverMethodConfigurator<T>

Returns:

self
addQualifiers
(Set<Annotation>
to add to event
qualifiers
)

Add all the qualifiers to the Observed event

public ObserverMethodConfigurator<T>

Returns:

self
async
(boolean
async status
async
)

Allows modification of the asynchronous status of the observer to build.

public ObserverMethodConfigurator<T>

Returns:

self
beanClass
(Class<?>
the bean class containing this configurator.
type
)

Set the class of the Bean containing this observer.

public ObserverMethodConfigurator<T>

Returns:

self
notifyWith
(ObserverMethodConfigurator.EventConsumer<T>
to call for the event notification
callback
)

Define an operation that accepts a context of a fired event.

public ObserverMethodConfigurator<T>

Returns:

self
observedType
(Type
of the observed event
type
)

Set the type of the observed event

public ObserverMethodConfigurator<T>

Returns:

self
priority
(int
priority of the observer
priority
)

Set the priority for the observer to build

public ObserverMethodConfigurator<T>

Returns:

self
qualifiers
(Annotation...
to put on event
qualifiers
)

Replace all qualifiers on the Observed event.

public ObserverMethodConfigurator<T>

Returns:

self
qualifiers
(Set<Annotation>
to put on event
qualifiers
)

Replace all qualifiers on the Observed event.

public ObserverMethodConfigurator<T>

Returns:

self
read
(Method
to read meta data from
method
)

Read observer meta data from a existing java.lang.reflect.Method

public ObserverMethodConfigurator<T>

Returns:

self
read
(AnnotatedMethod<?>
to read meta data from
method
)

Read observer meta data from a existing AnnotatedMethod

public ObserverMethodConfigurator<T>

Returns:

self
read
(ObserverMethod<T>
to read meta data from
method
)

Read observer meta data from a existing ObserverMethod

public ObserverMethodConfigurator<T>

Returns:

self
reception
(Reception
reception type
reception
)

Set the Reception mode for the observer to build

public ObserverMethodConfigurator<T>

Returns:

self
transactionPhase
(TransactionPhase
phase for the observer
transactionPhase
)

Set the TransactionPhase for the observer to build

Method Detail

addQualifierback to summary
public ObserverMethodConfigurator<T> addQualifier(Annotation qualifier)

Add the qualifier to the observed event

Parameters
qualifier:Annotation

to add to event

Returns:ObserverMethodConfigurator<T>

self

addQualifiersback to summary
public ObserverMethodConfigurator<T> addQualifiers(Annotation... qualifiers)

Add all the qualifiers to the Observed event

Parameters
qualifiers:Annotation[]

to add to event

Returns:ObserverMethodConfigurator<T>

self

addQualifiersback to summary
public ObserverMethodConfigurator<T> addQualifiers(Set<Annotation> qualifiers)

Add all the qualifiers to the Observed event

Parameters
qualifiers:Set<Annotation>

to add to event

Returns:ObserverMethodConfigurator<T>

self

asyncback to summary
public ObserverMethodConfigurator<T> async(boolean async)

Allows modification of the asynchronous status of the observer to build.

Parameters
async:boolean

async status

Returns:ObserverMethodConfigurator<T>

self

beanClassback to summary
public ObserverMethodConfigurator<T> beanClass(Class<?> type)

Set the class of the Bean containing this observer. If not set, the extension class is used.

Parameters
type:Class<?>

the bean class containing this configurator.

Returns:ObserverMethodConfigurator<T>

self

notifyWithback to summary
public ObserverMethodConfigurator<T> notifyWith(ObserverMethodConfigurator.EventConsumer<T> callback)

Define an operation that accepts a context of a fired event.

Parameters
callback:ObserverMethodConfigurator.EventConsumer<T>

to call for the event notification

Returns:ObserverMethodConfigurator<T>

self

observedTypeback to summary
public ObserverMethodConfigurator<T> observedType(Type type)

Set the type of the observed event

Parameters
type:Type

of the observed event

Returns:ObserverMethodConfigurator<T>

self

priorityback to summary
public ObserverMethodConfigurator<T> priority(int priority)

Set the priority for the observer to build

Parameters
priority:int

priority of the observer

Returns:ObserverMethodConfigurator<T>

self

qualifiersback to summary
public ObserverMethodConfigurator<T> qualifiers(Annotation... qualifiers)

Replace all qualifiers on the Observed event.

Parameters
qualifiers:Annotation[]

to put on event

Returns:ObserverMethodConfigurator<T>

self

qualifiersback to summary
public ObserverMethodConfigurator<T> qualifiers(Set<Annotation> qualifiers)

Replace all qualifiers on the Observed event.

Parameters
qualifiers:Set<Annotation>

to put on event

Returns:ObserverMethodConfigurator<T>

self

readback to summary
public ObserverMethodConfigurator<T> read(Method method)

Read observer meta data from a existing java.lang.reflect.Method

Parameters
method:Method

to read meta data from

Returns:ObserverMethodConfigurator<T>

self

readback to summary
public ObserverMethodConfigurator<T> read(AnnotatedMethod<?> method)

Read observer meta data from a existing AnnotatedMethod

Parameters
method:AnnotatedMethod<?>

to read meta data from

Returns:ObserverMethodConfigurator<T>

self

readback to summary
public ObserverMethodConfigurator<T> read(ObserverMethod<T> method)

Read observer meta data from a existing ObserverMethod

Parameters
method:ObserverMethod<T>

to read meta data from

Returns:ObserverMethodConfigurator<T>

self

receptionback to summary
public ObserverMethodConfigurator<T> reception(Reception reception)

Set the Reception mode for the observer to build

Parameters
reception:Reception

reception type

Returns:ObserverMethodConfigurator<T>

self

transactionPhaseback to summary
public ObserverMethodConfigurator<T> transactionPhase(TransactionPhase transactionPhase)

Set the TransactionPhase for the observer to build

Parameters
transactionPhase:TransactionPhase

phase for the observer

Returns:ObserverMethodConfigurator<T>

self

javax.enterprise.inject.spi.configurator back to summary

public Interface ObserverMethodConfigurator.EventConsumer<T>

Annotations
@FunctionalInterface

Represents an operation that accepts a context of a fired event.
Author
Martin Kouba
See Also
EventContext

Method Summary

Modifier and TypeMethod and Description
public void
accept(EventContext<T>
the EventContext used to fire the event
eventContext
)

Method Detail

acceptback to summary
public void accept(EventContext<T> eventContext) throws Exception
Parameters
eventContext:EventContext<T>

the EventContext used to fire the event

Exceptions
Exception:
The thrown checked exception is wrapped and rethrown as an (unchecked) ObserverException