Package tenapull.run

Class Job.Accessor

java.lang.Object
tenapull.run.Job.Accessor
Enclosing class:
Job

public final class Job.Accessor
extends java.lang.Object
The "accessor" allows for quasi-public access to private methods of Job, which should only be accessible to the main thread and to worker threads as necessary. By restricting access to the job's accessor, we can control who has access to these methods, making them effectively private for all but select classes.
  • Method Summary

    Modifier and Type Method Description
    Job getCurrentJob()
    Gets the job which this accessor represents
    java.util.Set<Job> getNewJobs()
    Gets new jobs.
    java.lang.Thread getRunThread()
    Gets run thread for the job represented by this accessor
    Job.Stage getStage()
    Gets stage the job is at
    long getTryAtTime()
    Gets try at time for the job represented by this accessor
    boolean hasException()
    Gets whether the job had an exception during its last run.
    boolean isFailed()
    Whether the job has failed

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getNewJobs

      public java.util.Set<Job> getNewJobs()
      Gets new jobs.
      Returns:
      the new jobs
    • getRunThread

      public final java.lang.Thread getRunThread()
      Gets run thread for the job represented by this accessor
      Returns:
      the run thread
    • isFailed

      public boolean isFailed()
      Whether the job has failed
      Returns:
      failure state
    • getStage

      public Job.Stage getStage()
      Gets stage the job is at
      Returns:
      the stage
    • hasException

      public boolean hasException()
      Gets whether the job had an exception during its last run. Not necessarily an indication of failure.
      Returns:
      the boolean
    • getTryAtTime

      public long getTryAtTime()
      Gets try at time for the job represented by this accessor
      Returns:
      the try at time
    • getCurrentJob

      public final Job getCurrentJob()
      Gets the job which this accessor represents
      Returns:
      the current job