S - the type of stateE - the type of eventpublic class TimerTrigger<S,E> extends LifecycleObjectSupport implements Trigger<S,E>
Trigger capable of firing on a
static periods.| Constructor and Description |
|---|
TimerTrigger(long period)
Instantiates a new timer trigger.
|
TimerTrigger(long period,
int count)
Instantiates a new timer trigger.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addTriggerListener(TriggerListener listener)
Adds the trigger listener.
|
void |
arm()
Arm a trigger.
|
void |
disarm()
Disarm a trigger.
|
protected reactor.core.publisher.Mono<java.lang.Void> |
doPreStartReactively()
Subclasses may implement this for pre start logic.
|
protected reactor.core.publisher.Mono<java.lang.Void> |
doPreStopReactively()
Subclasses may implement this for pre stop logic.
|
reactor.core.publisher.Mono<java.lang.Boolean> |
evaluate(TriggerContext<S,E> context)
Evaluate trigger.
|
int |
getCount() |
E |
getEvent()
Gets the event associated with this trigger.
|
long |
getPeriod() |
afterPropertiesSet, destroy, doDestroy, doPostStartReactively, doPostStopReactively, getBeanFactory, getPhase, isAutoStartup, isRunning, onInit, setAutoStartup, setBeanFactory, setPhase, start, startReactively, stop, stopReactivelypublic TimerTrigger(long period)
period - the period in millisecondspublic TimerTrigger(long period,
int count)
period - the periodcount - the countpublic long getPeriod()
public int getCount()
public reactor.core.publisher.Mono<java.lang.Boolean> evaluate(TriggerContext<S,E> context)
Triggerpublic void addTriggerListener(TriggerListener listener)
TriggeraddTriggerListener in interface Trigger<S,E>listener - the listenerpublic E getEvent()
Triggerprotected reactor.core.publisher.Mono<java.lang.Void> doPreStartReactively()
LifecycleObjectSupportdoPreStartReactively in class LifecycleObjectSupportprotected reactor.core.publisher.Mono<java.lang.Void> doPreStopReactively()
LifecycleObjectSupportdoPreStopReactively in class LifecycleObjectSupportpublic void arm()
TriggerTriggerListener
may receive events.