|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.axonframework.eventhandling.annotation.AnnotationEventListenerAdapter
public class AnnotationEventListenerAdapter
Adapter that turns any bean with EventHandler
annotated methods into an EventListener
.
EventListener
Constructor Summary | |
---|---|
AnnotationEventListenerAdapter(Object annotatedEventListener)
Wraps the given annotatedEventListener , allowing it to be subscribed to an Event Bus. |
|
AnnotationEventListenerAdapter(Object annotatedEventListener,
EventBus eventBus)
Deprecated. Use AnnotationEventListenerAdapter(Object) and subscribe the listener to the event bus
using EventBus.subscribe(org.axonframework.eventhandling.EventListener) |
|
AnnotationEventListenerAdapter(Object annotatedEventListener,
ParameterResolverFactory parameterResolverFactory)
Wraps the given annotatedEventListener , allowing it to be subscribed to an Event Bus. |
Method Summary | |
---|---|
void |
afterReplay()
Invoked when a replay has finished. |
void |
beforeReplay()
Invoked when a replay is started. |
Class<?> |
getTargetType()
Returns the instance type that this proxy delegates all event handling to. |
void |
handle(EventMessage event)
Process the given event. |
void |
onReplayFailed(Throwable cause)
Invoked when a replay has failed due to an exception. |
void |
subscribe()
Deprecated. Use EventBus.subscribe(org.axonframework.eventhandling.EventListener) and
pass this adapter instance to subscribe it. |
static AnnotationEventListenerAdapter |
subscribe(Object annotatedEventListener,
EventBus eventBus)
Subscribe the given annotatedEventListener to the given eventBus . |
void |
unsubscribe()
Deprecated. Use EventBus.unsubscribe(org.axonframework.eventhandling.EventListener) and
pass this adapter instance to unsubscribe it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AnnotationEventListenerAdapter(Object annotatedEventListener)
annotatedEventListener
, allowing it to be subscribed to an Event Bus.
annotatedEventListener
- the annotated event listenerpublic AnnotationEventListenerAdapter(Object annotatedEventListener, ParameterResolverFactory parameterResolverFactory)
annotatedEventListener
, allowing it to be subscribed to an Event Bus. The given
parameterResolverFactory
is used to resolve parameter values for handler methods.
annotatedEventListener
- the annotated event listenerparameterResolverFactory
- the strategy for resolving handler method parameter values@Deprecated public AnnotationEventListenerAdapter(Object annotatedEventListener, EventBus eventBus)
AnnotationEventListenerAdapter(Object)
and subscribe the listener to the event bus
using EventBus.subscribe(org.axonframework.eventhandling.EventListener)
annotatedEventListener
. When the
adapter
subscribes, it will subscribe to the given event bus.
annotatedEventListener
- the event listenereventBus
- the event bus to register the event listener toMethod Detail |
---|
public static AnnotationEventListenerAdapter subscribe(Object annotatedEventListener, EventBus eventBus)
annotatedEventListener
to the given eventBus
.
annotatedEventListener
- The annotated event listenereventBus
- The event bus to subscribe to
public void handle(EventMessage event)
handle
in interface EventListener
event
- the event to handle@PreDestroy @Deprecated public void unsubscribe()
EventBus.unsubscribe(org.axonframework.eventhandling.EventListener)
and
pass this adapter instance to unsubscribe it.
unsubscribe
in interface Subscribable
@PostConstruct @Deprecated public void subscribe()
EventBus.subscribe(org.axonframework.eventhandling.EventListener)
and
pass this adapter instance to subscribe it.
subscribe
in interface Subscribable
public Class<?> getTargetType()
EventListenerProxy
getTargetType
in interface EventListenerProxy
public void beforeReplay()
ReplayAware
beforeReplay
in interface ReplayAware
public void afterReplay()
ReplayAware
afterReplay
in interface ReplayAware
public void onReplayFailed(Throwable cause)
ReplayAware
onReplayFailed
in interface ReplayAware
cause
- The exception that stopped the replay;
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |