Package org.apache.ofbiz.service.job
Class AbstractJob
java.lang.Object
org.apache.ofbiz.service.job.AbstractJob
- All Implemented Interfaces:
Serializable
,Runnable
,Job
- Direct Known Subclasses:
GenericServiceJob
,PurgeJob
Abstract Job.
- See Also:
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the current state of this job.void
deQueue()
Transitions this job to the pre-queued (created) state.abstract void
exec()
Executes this Job.Gets current 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.void
queue()
Transitions this job to the queued state.void
run()
void
setCurrentState
(Job.State currentState) Sets current state.
-
Constructor Details
-
AbstractJob
-
-
Method Details
-
getCurrentState
Gets current state.- Returns:
- the current state
-
setCurrentState
Sets current state.- Parameters:
currentState
- the current state
-
currentState
Description copied from interface:Job
Returns the current state of this job.- Specified by:
currentState
in interfaceJob
-
getJobId
Description copied from interface:Job
Returns the ID of this Job. -
getJobName
Description copied from interface:Job
Returns the name of this Job.- Specified by:
getJobName
in interfaceJob
-
queue
Description copied from interface:Job
Transitions this job to the queued state.- Specified by:
queue
in interfaceJob
- Throws:
InvalidJobException
-
deQueue
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 interfaceJob
- Throws:
InvalidJobException
-
exec
Executes this Job. Therun()
method calls this method.- Throws:
InvalidJobException
-
run
public void run() -
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 interfaceJob
-
getStartTime
Description copied from interface:Job
Returns the time this job is scheduled to start.- Specified by:
getStartTime
in interfaceJob
-
getPriority
public long getPriority()Description copied from interface:Job
Returns the priority of this job, higher the number the higher the priority- Specified by:
getPriority
in interfaceJob
-