TriggerExecutor
Runs a TriggerConfiguration: decides when its task should start or stop.
Each trigger type has its own executor, created by a TriggerFactory via the ExecutorFactory. A TaskControlExecutor listens to triggerEvents and controls its task on each event. Subclasses call onTrigger to fire; pausing or disposing cancels timer.
To add a new trigger type, extend this class and register a TriggerFactory that creates it.
- Inheritance
-
- Object
- AbstractExecutor<
TConfig> - TriggerExecutor
- Implementers
- AppLifecycleTriggerExecutor
- ConditionalPeriodicTriggerExecutor
- ConditionalSamplingEventTriggerExecutor
- DelayedTriggerExecutor
- ImmediateTriggerExecutor
- NoOpTriggerExecutor
- NoUserTaskTriggerExecutor
- OneTimeTriggerExecutor
- PassiveTriggerExecutor
- SamplingEventTriggerExecutor
- SchedulableTriggerExecutor
- UserTaskTriggerExecutor
Constructors
TriggerExecutor
Properties
measurements
The stream of Measurement collected by this executor.
timer
A timer for subclasses to use. Cancelled on pause and dispose.
triggerEvents
The stream of events triggered from this trigger executor.
Methods
onDispose
Callback when this executor is disposed.
Subclasses should override this, to implement any cleanup to be done before disposing.
onInitialize
Called by initialize. Returns true if successfully initialized.
If false, the executor stays in ExecutorState.Created. This is a synchronous method and must be light-weight.
onPause
Called by pause. Returns true if successfully paused.
If false, the state is not changed.
onResume
Called by resume. Returns true if successfully resumed.
If false, the executor moves to ExecutorState.PausedButShouldBeResumed.
onTrigger
Fires this trigger by adding a TriggerEvent to triggerEvents.