Modifier and Type | Class and Description |
---|---|
static interface |
EventProcessor.ShutdownCallback
Callback that allows the SequenceManager to receive a notification when this scheduler finishes processing
events.
|
Constructor and Description |
---|
EventProcessor(Executor executor,
EventProcessor.ShutdownCallback shutDownCallback,
ErrorHandler errorHandler,
UnitOfWorkFactory unitOfWorkFactory,
Collection<EventListener> eventListeners)
Initialize a scheduler using the given
executor . |
Modifier and Type | Method and Description |
---|---|
protected RetryPolicy |
doHandle(EventMessage<?> event)
Does the actual processing of the event.
|
void |
run() |
boolean |
scheduleEvent(EventMessage<?> event)
Schedules an event for processing.
|
public EventProcessor(Executor executor, EventProcessor.ShutdownCallback shutDownCallback, ErrorHandler errorHandler, UnitOfWorkFactory unitOfWorkFactory, Collection<EventListener> eventListeners)
executor
. This scheduler uses an unbounded queue to schedule
events.executor
- The executor service that will process the eventsshutDownCallback
- The callback to notify when the scheduler finishes processing eventserrorHandler
- The error handler to invoke when an error occurs while committing a Unit of WorkunitOfWorkFactory
- The factory providing instances of the Unit of WorkeventListeners
- The event listeners that should handle incoming eventspublic boolean scheduleEvent(EventMessage<?> event)
event
- the event to scheduleIllegalStateException
- if the queue in this scheduler does not have the capacity to add this eventprotected RetryPolicy doHandle(EventMessage<?> event)
event
- The event to handleCopyright © 2010-2013. All Rights Reserved.