Package io.quarkus.scheduler.runtime
Class SimpleScheduler
- java.lang.Object
-
- io.quarkus.scheduler.runtime.SimpleScheduler
-
- All Implemented Interfaces:
Scheduler
@Typed(Scheduler.class) @Singleton public class SimpleScheduler extends Object implements Scheduler
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
SimpleScheduler.CronTrigger
(package private) static class
SimpleScheduler.IntervalTrigger
(package private) static class
SimpleScheduler.ScheduledTask
(package private) static class
SimpleScheduler.SimpleScheduledExecution
(package private) static class
SimpleScheduler.SimpleTrigger
-
Constructor Summary
Constructors Constructor Description SimpleScheduler(SchedulerContext context, SchedulerRuntimeConfig schedulerRuntimeConfig, javax.enterprise.event.Event<SkippedExecution> skippedExecutionEvent, javax.enterprise.event.Event<SuccessfulExecution> successExecutionEvent, javax.enterprise.event.Event<FailedExecution> failedExecutionEvent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
checkTriggers()
(package private) Optional<SimpleScheduler.SimpleTrigger>
createTrigger(String invokerClass, com.cronutils.parser.CronParser parser, Scheduled scheduled, int nameSequence, Duration defaultGracePeriod)
Trigger
getScheduledJob(String identity)
List<Trigger>
getScheduledJobs()
boolean
isPaused(String identity)
Identity must not be null andfalse
is returned for non-existent identity.boolean
isRunning()
void
pause()
Pause the scheduler.void
pause(String identity)
Pause a specific job.void
resume()
Resume the scheduler.void
resume(String identity)
Resume a specific job.(package private) void
start(io.quarkus.runtime.StartupEvent event)
(package private) void
stop()
-
-
-
Constructor Detail
-
SimpleScheduler
public SimpleScheduler(SchedulerContext context, SchedulerRuntimeConfig schedulerRuntimeConfig, javax.enterprise.event.Event<SkippedExecution> skippedExecutionEvent, javax.enterprise.event.Event<SuccessfulExecution> successExecutionEvent, javax.enterprise.event.Event<FailedExecution> failedExecutionEvent)
-
-
Method Detail
-
start
void start(@Observes @Priority(0) io.quarkus.runtime.StartupEvent event)
-
stop
@PreDestroy void stop()
-
checkTriggers
void checkTriggers()
-
pause
public void pause()
Description copied from interface:Scheduler
Pause the scheduler. No triggers are fired.
-
pause
public void pause(String identity)
Description copied from interface:Scheduler
Pause a specific job. Identity must not be null and non-existent identity results in no-op.- Specified by:
pause
in interfaceScheduler
- See Also:
Scheduled.identity()
-
isPaused
public boolean isPaused(String identity)
Description copied from interface:Scheduler
Identity must not be null andfalse
is returned for non-existent identity.- Specified by:
isPaused
in interfaceScheduler
- Returns:
true
if the job with the given identity is paused,false
otherwise- See Also:
Scheduled.identity()
-
resume
public void resume()
Description copied from interface:Scheduler
Resume the scheduler. Triggers can be fired again.
-
resume
public void resume(String identity)
Description copied from interface:Scheduler
Resume a specific job. Identity must not be null and non-existent identity results in no-op.- Specified by:
resume
in interfaceScheduler
- See Also:
Scheduled.identity()
-
isRunning
public boolean isRunning()
-
createTrigger
Optional<SimpleScheduler.SimpleTrigger> createTrigger(String invokerClass, com.cronutils.parser.CronParser parser, Scheduled scheduled, int nameSequence, Duration defaultGracePeriod)
-
getScheduledJobs
public List<Trigger> getScheduledJobs()
- Specified by:
getScheduledJobs
in interfaceScheduler
- Returns:
- an immutable list of scheduled jobs represented by their trigger.
-
getScheduledJob
public Trigger getScheduledJob(String identity)
- Specified by:
getScheduledJob
in interfaceScheduler
- Returns:
- the trigger of a specific job or null for non-existent identity.
-
-