Interface Scheduler


public interface Scheduler
The container provides a built-in bean with bean type Scheduler and qualifier Default.
  • Method Details

    • pause

      void pause()
      Pause the scheduler. No triggers are fired.
    • pause

      void pause(String identity)
      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

      void resume(String identity)
      Resume a specific job. Identity must not be null and non-existent identity results in no-op.
      Parameters:
      identity -
      See Also:
    • isPaused

      boolean isPaused(String identity)
      Identity must not be null and false is returned for non-existent identity.

      Note that this method only returns true if the job was explicitly paused. I.e. it does not reflect a paused scheduler.

      Parameters:
      identity -
      Returns:
      true if the job with the given identity is paused, false otherwise
      See Also:
    • isRunning

      boolean isRunning()
      Returns:
      true if a scheduler is running the triggers are fired and jobs are executed, false otherwise
    • getScheduledJobs

      List<Trigger> getScheduledJobs()
      Returns:
      an immutable list of scheduled jobs represented by their trigger.
    • getScheduledJob

      Trigger getScheduledJob(String identity)
      Returns:
      the trigger of a specific job or null for non-existent identity.
    • newJob

      Scheduler.JobDefinition newJob(String identity)
      Creates a new job definition. The job is not scheduled until the Scheduler.JobDefinition.schedule() method is called.

      The properties of the job definition have the same semantics as their equivalents in the Scheduled annotation.

      Parameters:
      identity - The identity must be unique for the scheduler
      Returns:
      a new job definition
      See Also:
    • unscheduleJob

      Trigger unscheduleJob(String identity)
      Removes the job previously added via newJob(String).

      It is a no-op if the identified job was not added programmatically.

      Parameters:
      identity -
      Returns:
      the trigger or null if no such job exists
    • implementation

      String implementation()
      Returns:
      the implementation
      See Also: