Class ScheduledJob

java.lang.Object
titan.scheduler.ScheduledJob
All Implemented Interfaces:
Comparable<Delayed>, Delayed

public class ScheduledJob extends Object implements Delayed
Represents a job that is scheduled to run at a future time. This class wraps a Job and implements the Delayed interface, allowing it to be used with DelayQueue for time-based scheduling. The delay is determined by the Job.getScheduledTime() property.
  • Field Details

    • job

      private final Job job
  • Constructor Details

    • ScheduledJob

      public ScheduledJob(Job job)
      Constructs a new ScheduledJob with the specified job. The scheduling time for this job is derived from the provided Job object.
      Parameters:
      job - The Job to be scheduled. Must not be null.
  • Method Details

    • getJob

      public Job getJob()
      Returns the underlying Job instance associated with this scheduled job.
      Returns:
      The Job that this ScheduledJob is wrapping.
    • getDelay

      public long getDelay(TimeUnit unit)
      Specified by:
      getDelay in interface Delayed
    • compareTo

      public int compareTo(Delayed other)
      Specified by:
      compareTo in interface Comparable<Delayed>