The Scheduling Helper

The Scheduling Helper is the component that executes your scheduled work. When a trigger fires (for a one-time or recurring job), the scheduler locates the helper that supports the job’s command and invokes it.

Interface

A SchedulingHelper exposes three methods:

1. CompletionStage<Void> execute(String id, SchedulingCommand cmd)

Invoked at the scheduled time. The id is the triggerIdentifier from the JobSpecification, and cmd is the triggerCommand.

2. CompletionStage<Void> lateExecute(String id, SchedulingCommand cmd, Duration overThreshold)

Invoked instead of execute(…​) only when the job has opted in to late execution handling via lateExecutionThreshold and the threshold is exceeded at run time. The default implementation delegates to execute(…​).

3. boolean supports(SchedulingCommand cmd)

Determines whether this helper handles the given command type. When multiple helpers are present, the scheduler chooses the first helper that returns true.