Modifier and Type | Class and Description |
---|---|
protected static class |
EventProcessor.ProcessingResult
Class indicating the result of Event Processing and the policy for resuming or retrying in case of errors.
|
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,
Set<EventListener> eventListeners,
MultiplexingEventProcessingMonitor eventProcessingMonitor)
Initialize a scheduler using the given
executor . |
Modifier and Type | Method and Description |
---|---|
protected EventProcessor.ProcessingResult |
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, Set<EventListener> eventListeners, MultiplexingEventProcessingMonitor eventProcessingMonitor)
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 eventseventProcessingMonitor
- The listener to notify when processing completedpublic boolean scheduleEvent(EventMessage<?> event)
event
- the event to scheduleIllegalStateException
- if the queue in this scheduler does not have the capacity to add this eventprotected EventProcessor.ProcessingResult doHandle(EventMessage<?> event)
event
- The event to handleCopyright © 2010-2014. All Rights Reserved.