public interface EventHandlerIF
Modifier and Type | Method and Description |
---|---|
int |
getEventCount()
Get the number of events in the queue that are ready to be processed.
|
int |
getEventCountToRetry()
Get the number of failed events in the queue that are ready to be retried.
|
MoMaLauncherTriggerEvent |
getNextEvent()
Get the next event in the queue.
|
MoMaLauncherTriggerEvent |
getNextEventToRetry()
Get the next event to retry
The implementation should only return events with a retry count < MoMaLauncher.maxRetryCount and an
event time older than now() - MoMaLauncher.RetryIntervalSeconds.
|
int |
getPermanentErrorCount()
Get the number of failed events in the queue that have reached the maximum retry count.
|
boolean |
init(java.util.Properties p)
Does the initialization.
|
void |
setContext(XSDContextIF ctx)
Set the context for the event handler.
|
void |
setEventState(MoMaLauncherTriggerEvent event,
MoMaLauncherTriggerEvent.EventState state)
Set the state of an event
|
void |
setLogger(java.util.logging.Logger logger)
Pass the logger to the event handler to enable logging to the same file as the MoMaLauncher
|
void |
setMaxRetryCount(int maxRetryCount)
Set the maximum number of attempts to retry a failed event
|
void |
setMinEventAgeSeconds(int minEventAgeSeconds)
Set the number of seconds to wait before an event is processed.
|
void |
setNotConnectedSleepTime(int notConnectedSleepTime)
Set the number of seconds to wait before connection to the trigger source is retried after a disconnect.
|
void |
setRetryIntervalSeconds(int retryIntervalSeconds)
Set the number of seconds to wait before a failed event is retried.
|
void setLogger(java.util.logging.Logger logger)
logger
- The logger defined for the MoMaLaunchervoid setContext(XSDContextIF ctx)
ctx
- The context used by the MoMaLauncherboolean init(java.util.Properties p)
p
- The properties. All Properties defined for the MoMaLauncher are passed to the
EventHandlerMoMaLauncherTriggerEvent getNextEvent()
int getEventCount()
int getEventCountToRetry()
int getPermanentErrorCount()
void setEventState(MoMaLauncherTriggerEvent event, MoMaLauncherTriggerEvent.EventState state)
event
- The event to modifystate
- The new stateMoMaLauncherTriggerEvent getNextEventToRetry()
void setMinEventAgeSeconds(int minEventAgeSeconds)
minEventAgeSeconds
- void setMaxRetryCount(int maxRetryCount)
maxRetryCount
- void setRetryIntervalSeconds(int retryIntervalSeconds)
retryIntervalSeconds
- The number of seconds to waitvoid setNotConnectedSleepTime(int notConnectedSleepTime)
retryIntervalSeconds
- The number of seconds to wait