Package org.apache.ofbiz.service.job
Interface Job
- All Superinterfaces:
Runnable
- All Known Implementing Classes:
AbstractJob
,GenericServiceJob
,PersistedServiceJob
,PurgeJob
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
-
Method Summary
Modifier and TypeMethodDescriptionReturns the current state of this job.void
deQueue()
Transitions this job to the pre-queued (created) state.getJobId()
Returns the ID of this Job.Returns the name of this Job.long
Returns the priority of this job, higher the number the higher the prioritylong
Returns the job execution time in milliseconds.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 Details
-
currentState
Job.State currentState()Returns the current state of this job. -
getJobId
String getJobId()Returns the ID of this Job. -
getJobName
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
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
Transitions this job to the queued state.- Throws:
InvalidJobException
-
getStartTime
Date getStartTime()Returns the time this job is scheduled to start. -
getPriority
long getPriority()Returns the priority of this job, higher the number the higher the priority
-