Package org.apache.ofbiz.service.job
Interface Job
-
- All Superinterfaces:
java.lang.Runnable
- All Known Implementing Classes:
AbstractJob
,GenericServiceJob
,PersistedServiceJob
,PurgeJob
public interface Job extends java.lang.Runnable
A scheduled job.A job starts out in the created state. When the job is queued for execution, it transitions to the queued state. While the job is executing it is in the running state. When the job execution ends, it transitions to the finished or failed state - depending on the outcome of the task that was performed.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Job.State
-
Method Summary
All Methods Instance Methods Abstract 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.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.boolean
isValid()
Returns true if this job is ready to be queued.void
queue()
Transitions this job to the queued state.
-
-
-
Method Detail
-
currentState
Job.State currentState()
Returns the current state of this job.
-
getJobId
java.lang.String getJobId()
Returns the ID of this Job.
-
getJobName
java.lang.String getJobName()
Returns the name of this Job.
-
getRuntime
long getRuntime()
Returns the job execution time in milliseconds. Returns zero if the job has not run.
-
isValid
boolean isValid()
Returns true if this job is ready to be queued.
-
deQueue
void deQueue() throws InvalidJobException
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.- Throws:
InvalidJobException
-
queue
void queue() throws InvalidJobException
Transitions this job to the queued state.- Throws:
InvalidJobException
-
getStartTime
java.util.Date getStartTime()
Returns the time this job is scheduled to start.
-
-