Class SchedulerListeners
- java.lang.Object
-
- com.github.kagkarlsson.scheduler.event.SchedulerListeners
-
- All Implemented Interfaces:
SchedulerListener
public class SchedulerListeners extends Object implements SchedulerListener
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.github.kagkarlsson.scheduler.event.SchedulerListener
SchedulerListener.CandidateEventType, SchedulerListener.SchedulerEventType
-
-
Field Summary
Fields Modifier and Type Field Description static SchedulerListenersNOOP
-
Constructor Summary
Constructors Constructor Description SchedulerListeners(SchedulerListener... schedulerListeners)SchedulerListeners(List<SchedulerListener> schedulerListeners)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(SchedulerListener listener)voidfireAndLogErrors(SchedulerListener listener, String method, Runnable r)voidonCandidateEvent(SchedulerListener.CandidateEventType type)Internal scheduler event.voidonExecutionComplete(ExecutionComplete executionComplete)ExecutionHandlerdone.voidonExecutionDead(Execution execution)Scheduler has detected a dead execution.voidonExecutionFailedHeartbeat(CurrentlyExecuting currentlyExecuting)Scheduler failed to update heartbeat-timestamp for execution that it is currently executing.voidonExecutionScheduled(TaskInstanceId taskInstanceId, Instant executionTime)Execution scheduled either by theSchedulerClientor by aCompletionHandlervoidonExecutionStart(CurrentlyExecuting currentlyExecuting)Execution picked andExecutionHandlerabout to run.voidonSchedulerEvent(SchedulerListener.SchedulerEventType type)Internal scheduler event.
-
-
-
Field Detail
-
NOOP
public static final SchedulerListeners NOOP
-
-
Constructor Detail
-
SchedulerListeners
public SchedulerListeners(SchedulerListener... schedulerListeners)
-
SchedulerListeners
public SchedulerListeners(List<SchedulerListener> schedulerListeners)
-
-
Method Detail
-
add
public void add(SchedulerListener listener)
-
onExecutionScheduled
public void onExecutionScheduled(TaskInstanceId taskInstanceId, Instant executionTime)
Description copied from interface:SchedulerListenerExecution scheduled either by theSchedulerClientor by aCompletionHandler- Specified by:
onExecutionScheduledin interfaceSchedulerListener
-
onExecutionStart
public void onExecutionStart(CurrentlyExecuting currentlyExecuting)
Description copied from interface:SchedulerListenerExecution picked andExecutionHandlerabout to run. Will typically run in the same thread asonExecutionComplete- Specified by:
onExecutionStartin interfaceSchedulerListener
-
onExecutionComplete
public void onExecutionComplete(ExecutionComplete executionComplete)
Description copied from interface:SchedulerListenerExecutionHandlerdone. Will typically run in the same thread asonExecutionStart- Specified by:
onExecutionCompletein interfaceSchedulerListener
-
onExecutionDead
public void onExecutionDead(Execution execution)
Description copied from interface:SchedulerListenerScheduler has detected a dead execution. About to runDeadExecutionHandler.- Specified by:
onExecutionDeadin interfaceSchedulerListener
-
onExecutionFailedHeartbeat
public void onExecutionFailedHeartbeat(CurrentlyExecuting currentlyExecuting)
Description copied from interface:SchedulerListenerScheduler failed to update heartbeat-timestamp for execution that it is currently executing. Multiple failures will eventually lead to the execution being declared dead (and itsDeadExecutionHandlertriggered).- Specified by:
onExecutionFailedHeartbeatin interfaceSchedulerListener
-
onSchedulerEvent
public void onSchedulerEvent(SchedulerListener.SchedulerEventType type)
Description copied from interface:SchedulerListenerInternal scheduler event. Primarily intended for testing.- Specified by:
onSchedulerEventin interfaceSchedulerListener
-
onCandidateEvent
public void onCandidateEvent(SchedulerListener.CandidateEventType type)
Description copied from interface:SchedulerListenerInternal scheduler event. Primarily intended for testing.- Specified by:
onCandidateEventin interfaceSchedulerListener
-
fireAndLogErrors
public void fireAndLogErrors(SchedulerListener listener, String method, Runnable r)
-
-