public final class CommandEventHandler extends AbstractEventHandler
| Modifier and Type | Field and Description |
|---|---|
private CommandEventPipeline |
m_eventPipeline |
private CommandFailureHandler |
m_failureHandler |
private SwitchedEnqueuePredicate |
m_predicate |
| Constructor and Description |
|---|
CommandEventHandler(CommandFailureHandler failureHandler,
SwitchedEnqueuePredicate predicate)
Create the CommandEventHandler with the failure handler and the
predicate provided.
|
| Modifier and Type | Method and Description |
|---|---|
private void |
checkPipelineProvided() |
CommandFailureHandler |
getCommandFailureHandler()
Get the CommandFailureHandler in use for this event handler.
|
void |
handleEvent(java.lang.Object element)
Handle one event at a time.
|
void |
setCommandEventPipeline(CommandEventPipeline pipeline)
Provide the CommandEventPipeline to use for requeueing delayed
and repeating commands.
|
void |
setCommandFailureHandler(CommandFailureHandler handler)
Set the CommandFailureHandler to use with this event handler.
|
private boolean |
timeToRequeue(DefaultCommandManager.DelayedCommandInfo info) |
java.lang.String |
toString()
Provide a debug string for this class.
|
handleEventsprivate CommandEventPipeline m_eventPipeline
private CommandFailureHandler m_failureHandler
private final SwitchedEnqueuePredicate m_predicate
public CommandEventHandler(CommandFailureHandler failureHandler, SwitchedEnqueuePredicate predicate)
failureHandler - The CommandFailureHandler used when a
command failspredicate - The predicate used to determine if we are
accepting new commandspublic void setCommandEventPipeline(CommandEventPipeline pipeline)
pipeline - The pipeline to use for processingpublic void handleEvent(java.lang.Object element)
EventHandlerelement - The element that the EventHandler must processprivate void checkPipelineProvided()
private boolean timeToRequeue(DefaultCommandManager.DelayedCommandInfo info) throws SinkException
SinkExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic CommandFailureHandler getCommandFailureHandler()
public void setCommandFailureHandler(CommandFailureHandler handler)
handler - the new handler