Package org.apache.ofbiz.service.job
Class PersistedServiceJob
java.lang.Object
org.apache.ofbiz.service.job.AbstractJob
org.apache.ofbiz.service.job.GenericServiceJob
org.apache.ofbiz.service.job.PersistedServiceJob
- All Implemented Interfaces:
Serializable
,Runnable
,Job
A
Job
that is backed by the entity engine. Job data is stored
in the JobSandbox entity.
When the job is queued, this object "owns" the entity value. Any external changes are ignored except the cancelDateTime field - jobs can be canceled after they are queued.
- See Also:
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionPersistedServiceJob
(DispatchContext dctx, GenericValue jobValue, GenericRequester req) Creates a new PersistedServiceJob -
Method Summary
Modifier and TypeMethodDescriptionvoid
deQueue()
Transitions this job to the pre-queued (created) state.protected void
Method is called when the service fails.protected void
Method is called after the service has finished successfully.Gets the context for the service invocation.long
Returns the priority of this job, higher the number the higher the priorityprotected String
Gets the name of the service as defined in the definition file.Returns the time this job is scheduled to start.protected void
init()
Method is called prior to running the service.void
queue()
Transitions this job to the queued state.Methods inherited from class org.apache.ofbiz.service.job.GenericServiceJob
exec, getDctx, isValid
Methods inherited from class org.apache.ofbiz.service.job.AbstractJob
currentState, getCurrentState, getJobId, getJobName, getRuntime, run, setCurrentState
-
Constructor Details
-
PersistedServiceJob
Creates a new PersistedServiceJob- Parameters:
dctx
-jobValue
-req
-
-
-
Method Details
-
queue
Description copied from interface:Job
Transitions this job to the queued state.- Specified by:
queue
in interfaceJob
- Overrides:
queue
in classAbstractJob
- Throws:
InvalidJobException
-
init
Description copied from class:GenericServiceJob
Method is called prior to running the service.- Overrides:
init
in classGenericServiceJob
- Throws:
InvalidJobException
-
finish
Description copied from class:GenericServiceJob
Method is called after the service has finished successfully.- Overrides:
finish
in classGenericServiceJob
- Throws:
InvalidJobException
-
failed
Description copied from class:GenericServiceJob
Method is called when the service fails.- Overrides:
failed
in classGenericServiceJob
- Parameters:
t
- Throwable- Throws:
InvalidJobException
-
getServiceName
Description copied from class:GenericServiceJob
Gets the name of the service as defined in the definition file.- Overrides:
getServiceName
in classGenericServiceJob
- Returns:
- The name of the service to be invoked.
-
getContext
Description copied from class:GenericServiceJob
Gets the context for the service invocation.- Overrides:
getContext
in classGenericServiceJob
- Returns:
- Map of name value pairs making up the service context.
- 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
- Overrides:
deQueue
in classGenericServiceJob
- Throws:
InvalidJobException
-
getStartTime
Description copied from interface:Job
Returns the time this job is scheduled to start.- Specified by:
getStartTime
in interfaceJob
- Overrides:
getStartTime
in classAbstractJob
-
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
- Overrides:
getPriority
in classAbstractJob
-