|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.axonframework.eventhandling.AsynchronousEventHandlerWrapper
public class AsynchronousEventHandlerWrapper
The AsynchronousEventHandlerWrapper can wrap any event listener to give it asynchronous behavior. The wrapper will schedule all incoming events for processing, making the calling thread return immediately.
| Constructor Summary | |
|---|---|
AsynchronousEventHandlerWrapper(EventListener eventListener,
EventSequencingPolicy eventSequencingPolicy,
Executor executor)
Initialize the AsynchronousEventHandlerWrapper for the given eventListener using the given
executor. |
|
AsynchronousEventHandlerWrapper(EventListener eventListener,
TransactionManager transactionManager,
EventSequencingPolicy eventSequencingPolicy,
Executor executor)
Initialize the AsynchronousEventHandlerWrapper for the given eventListener using the given
executor and transactionManager. |
|
| Method Summary | |
|---|---|
Object |
getTarget()
Returns the instance that this proxy delegates all event handling to |
void |
handle(Event event)
Handles the event by scheduling it for execution by the target event handler. |
protected EventProcessingScheduler |
newProcessingScheduler(org.axonframework.eventhandling.EventProcessingScheduler.ShutdownCallback shutDownCallback)
Creates a new scheduler instance for the eventListener that schedules events on the executor service for the managed EventListener. |
protected EventProcessingScheduler |
newProcessingScheduler(Queue<Event> eventQueue,
org.axonframework.eventhandling.EventProcessingScheduler.ShutdownCallback shutDownCallback)
Creates a new scheduler instance for the eventListener that schedules events on the executor service for the managed EventListener. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AsynchronousEventHandlerWrapper(EventListener eventListener,
TransactionManager transactionManager,
EventSequencingPolicy eventSequencingPolicy,
Executor executor)
eventListener using the given
executor and transactionManager. The transaction manager is used to start and stop any
underlying transactions necessary for event processing.
eventListener - The event listener this instance managestransactionManager - The transaction manager that will manage underlying transactions for this eventeventSequencingPolicy - The sequencing policy for concurrent execution of eventsexecutor - The executor that processes the events
public AsynchronousEventHandlerWrapper(EventListener eventListener,
EventSequencingPolicy eventSequencingPolicy,
Executor executor)
eventListener using the given
executor.
Note that the underlying bean will not be notified of any transactions.
eventListener - The event listener this instance manageseventSequencingPolicy - The sequencing policy for concurrent execution of eventsexecutor - The executor that processes the eventsAsynchronousEventHandlerWrapper(EventListener, TransactionManager, EventSequencingPolicy,
java.util.concurrent.Executor)| Method Detail |
|---|
public void handle(Event event)
handle in interface EventListenerevent - The event to scheduleprotected EventProcessingScheduler newProcessingScheduler(org.axonframework.eventhandling.EventProcessingScheduler.ShutdownCallback shutDownCallback)
shutDownCallback - The callback that needs to be notified when the scheduler stops processing.
protected EventProcessingScheduler newProcessingScheduler(Queue<Event> eventQueue,
org.axonframework.eventhandling.EventProcessingScheduler.ShutdownCallback shutDownCallback)
eventQueue.
eventQueue - The event queue from which the scheduler must fetch eventsshutDownCallback - The callback that needs to be notified when the scheduler stops processing.
public Object getTarget()
EventListenerProxy
getTarget in interface EventListenerProxy
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||