Class AbstractJob

  • All Implemented Interfaces:
    java.lang.Runnable, Job
    Direct Known Subclasses:
    GenericServiceJob, PurgeJob

    public abstract class AbstractJob
    extends java.lang.Object
    implements Job
    Abstract Job.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.apache.ofbiz.service.job.Job

        Job.State
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AbstractJob​(java.lang.String jobId, java.lang.String jobName)  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      Job.State currentState()
      Returns the current state of this job.
      void deQueue()
      Transitions this job to the pre-queued (created) state.
      abstract void exec()
      Executes this Job.
      java.lang.String getJobId()
      Returns the ID of this Job.
      java.lang.String getJobName()
      Returns the name of this Job.
      long getRuntime()
      Returns the job execution time in milliseconds.
      java.util.Date getStartTime()
      Returns the time this job is scheduled to start.
      void queue()
      Transitions this job to the queued state.
      void run()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.apache.ofbiz.service.job.Job

        isValid
    • Field Detail

      • module

        public static final java.lang.String module
      • currentState

        protected Job.State currentState
    • Constructor Detail

      • AbstractJob

        protected AbstractJob​(java.lang.String jobId,
                              java.lang.String jobName)
    • Method Detail

      • currentState

        public Job.State currentState()
        Description copied from interface: Job
        Returns the current state of this job.
        Specified by:
        currentState in interface Job
      • getJobId

        public java.lang.String getJobId()
        Description copied from interface: Job
        Returns the ID of this Job.
        Specified by:
        getJobId in interface Job
      • getJobName

        public java.lang.String getJobName()
        Description copied from interface: Job
        Returns the name of this Job.
        Specified by:
        getJobName in interface Job
      • deQueue

        public void deQueue()
                     throws InvalidJobException
        Description copied from interface: Job
        Transitions this job to the pre-queued (created) state. The job manager will call this method when there was a problem adding this job to the queue.
        Specified by:
        deQueue in interface Job
        Throws:
        InvalidJobException
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
      • getRuntime

        public long getRuntime()
        Description copied from interface: Job
        Returns the job execution time in milliseconds. Returns zero if the job has not run.
        Specified by:
        getRuntime in interface Job
      • getStartTime

        public java.util.Date getStartTime()
        Description copied from interface: Job
        Returns the time this job is scheduled to start.
        Specified by:
        getStartTime in interface Job