org.ofbiz.service.job
Class AbstractJob

java.lang.Object
  extended by org.ofbiz.service.job.AbstractJob
All Implemented Interfaces:
java.io.Serializable, Job
Direct Known Subclasses:
GenericServiceJob

public abstract class AbstractJob
extends java.lang.Object
implements Job

Abstract Service Job - Invokes a service

See Also:
Serialized Form

Field Summary
static java.lang.String module
           
protected  long runtime
           
protected  long sequence
           
 
Constructor Summary
protected AbstractJob(java.lang.String jobId, java.lang.String jobName)
           
 
Method Summary
abstract  void exec()
          Executes the 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 time to run in milliseconds.
 boolean isValid()
          Returns true if this job is still valid.
 void queue()
          Flags this job as 'is-queued'
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

module

public static final java.lang.String module

runtime

protected long runtime

sequence

protected long sequence
Constructor Detail

AbstractJob

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

getRuntime

public long getRuntime()
Returns the time to run in milliseconds.

Specified by:
getRuntime in interface Job

isValid

public boolean isValid()
Returns true if this job is still valid.

Specified by:
isValid in interface Job

getJobId

public java.lang.String getJobId()
Returns the ID of this Job.

Specified by:
getJobId in interface Job

getJobName

public java.lang.String getJobName()
Returns the name of this Job.

Specified by:
getJobName in interface Job

queue

public void queue()
           throws InvalidJobException
Flags this job as 'is-queued'

Specified by:
queue in interface Job
Throws:
InvalidJobException

exec

public abstract void exec()
                   throws InvalidJobException
Executes the Job.

Specified by:
exec in interface Job
Throws:
InvalidJobException