Package io.quarkus.scheduler
Interface Scheduler
public interface Scheduler
The container provides a built-in bean with bean type
Scheduler and qualifier
Default.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceThe job definition is a builder-like API that can be used to define a job programmatically. -
Method Summary
Modifier and TypeMethodDescriptiongetScheduledJob(String identity) booleanIdentity must not be null andfalseis returned for non-existent identity.booleanCreates a new job definition.voidpause()Pause the scheduler.voidPause a specific job.voidresume()Resume the scheduler.voidResume a specific job.unscheduleJob(String identity) Removes the job previously added vianewJob(String).
-
Method Details
-
pause
void pause()Pause the scheduler. No triggers are fired. -
pause
Pause a specific job. Identity must not be null and non-existent identity results in no-op.- Parameters:
identity-- See Also:
-
resume
void resume()Resume the scheduler. Triggers can be fired again. -
resume
Resume a specific job. Identity must not be null and non-existent identity results in no-op.- Parameters:
identity-- See Also:
-
isPaused
Identity must not be null andfalseis returned for non-existent identity.Note that this method only returns
trueif the job was explicitly paused. I.e. it does not reflect a paused scheduler.- Parameters:
identity-- Returns:
trueif the job with the given identity is paused,falseotherwise- See Also:
-
isRunning
boolean isRunning()- Returns:
trueif a scheduler is running the triggers are fired and jobs are executed,falseotherwise
-
getScheduledJobs
- Returns:
- an immutable list of scheduled jobs represented by their trigger.
-
getScheduledJob
- Returns:
- the trigger of a specific job or null for non-existent identity.
-
newJob
Creates a new job definition. The job is not scheduled until theScheduler.JobDefinition.schedule()method is called.The properties of the job definition have the same semantics as their equivalents in the
Scheduledannotation.- Parameters:
identity- The identity must be unique for the scheduler- Returns:
- a new job definition
- See Also:
-
unscheduleJob
Removes the job previously added vianewJob(String).It is a no-op if the identified job was not added programmatically.
- Parameters:
identity-- Returns:
- the trigger or
nullif no such job exists
-
implementation
String implementation()- Returns:
- the implementation
- See Also:
-