Class JobDeclaration<S,T extends JobEntity>
- java.lang.Object
-
- org.camunda.bpm.engine.impl.jobexecutor.JobDeclaration<S,T>
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
BatchJobDeclaration,BatchMonitorJobDeclaration,BatchSeedJobDeclaration,EventSubscriptionJobDeclaration,HistoryCleanupJobDeclaration,MessageJobDeclaration,TimerDeclarationImpl
public abstract class JobDeclaration<S,T extends JobEntity> extends java.lang.Object implements java.io.SerializableA job declaration is associated with an activity in the process definition graph. It provides data about jobs which are to be created when executing this activity. It also acts as a factory for new Job Instances.
Jobs are of a type T and are created in the context of type S (e.g. an execution or an event subscription). An instance of the context class is handed in when a job is created.
- Author:
- Daniel Meyer
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected ActivityImplactivityprotected booleanexclusiveprotected java.lang.StringjobConfigurationprotected java.lang.StringjobDefinitionIdthe id of the associated persistent jobDefinitionIdprotected JobHandlerConfigurationjobHandlerConfigurationprotected java.lang.StringjobHandlerTypeprotected ParameterValueProviderjobPriorityProvider
-
Constructor Summary
Constructors Constructor Description JobDeclaration(java.lang.String jobHandlerType)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description TcreateJobInstance(S context)ActivityImplgetActivity()java.lang.StringgetActivityId()java.lang.StringgetJobConfiguration()java.lang.StringgetJobDefinitionId()java.lang.StringgetJobHandlerType()ParameterValueProvidergetJobPriorityProvider()ProcessDefinitionImplgetProcessDefinition()booleanisExclusive()protected abstract TnewJobInstance(S context)protected voidpostInitialize(S context, T job)general callback to override any configuration after the defaults have been appliedTreconfigure(S context, T job)Re-initialize configuration part.java.util.DateresolveDueDate(S context)protected booleanresolveExclusive(S context)protected abstract ExecutionEntityresolveExecution(S context)Returns the execution in which context the job is created.protected java.lang.StringresolveJobDefinitionId(S context)protected JobHandlerresolveJobHandler()protected abstract JobHandlerConfigurationresolveJobHandlerConfiguration(S context)protected java.lang.StringresolveJobHandlerType(S context)protected intresolveRetries(S context)voidsetActivity(ActivityImpl activity)voidsetExclusive(boolean exclusive)voidsetJobConfiguration(java.lang.String jobConfiguration)voidsetJobDefinitionId(java.lang.String jobDefinitionId)voidsetJobPriorityProvider(ParameterValueProvider jobPriorityProvider)
-
-
-
Field Detail
-
jobDefinitionId
protected java.lang.String jobDefinitionId
the id of the associated persistent jobDefinitionId
-
jobHandlerType
protected java.lang.String jobHandlerType
-
jobHandlerConfiguration
protected JobHandlerConfiguration jobHandlerConfiguration
-
jobConfiguration
protected java.lang.String jobConfiguration
-
exclusive
protected boolean exclusive
-
activity
protected ActivityImpl activity
-
jobPriorityProvider
protected ParameterValueProvider jobPriorityProvider
-
-
Method Detail
-
postInitialize
protected void postInitialize(S context, T job)
general callback to override any configuration after the defaults have been applied
-
resolveExecution
protected abstract ExecutionEntity resolveExecution(S context)
Returns the execution in which context the job is created. The execution is used to determine the job's priority based on a BPMN activity the execution is currently executing. May be null.
-
getJobDefinitionId
public java.lang.String getJobDefinitionId()
-
resolveJobDefinitionId
protected java.lang.String resolveJobDefinitionId(S context)
-
setJobDefinitionId
public void setJobDefinitionId(java.lang.String jobDefinitionId)
-
getJobHandlerType
public java.lang.String getJobHandlerType()
-
resolveJobHandler
protected JobHandler resolveJobHandler()
-
resolveJobHandlerType
protected java.lang.String resolveJobHandlerType(S context)
-
resolveJobHandlerConfiguration
protected abstract JobHandlerConfiguration resolveJobHandlerConfiguration(S context)
-
resolveExclusive
protected boolean resolveExclusive(S context)
-
resolveRetries
protected int resolveRetries(S context)
-
resolveDueDate
public java.util.Date resolveDueDate(S context)
-
isExclusive
public boolean isExclusive()
-
setExclusive
public void setExclusive(boolean exclusive)
-
getActivityId
public java.lang.String getActivityId()
-
getActivity
public ActivityImpl getActivity()
-
setActivity
public void setActivity(ActivityImpl activity)
-
getProcessDefinition
public ProcessDefinitionImpl getProcessDefinition()
-
getJobConfiguration
public java.lang.String getJobConfiguration()
-
setJobConfiguration
public void setJobConfiguration(java.lang.String jobConfiguration)
-
getJobPriorityProvider
public ParameterValueProvider getJobPriorityProvider()
-
setJobPriorityProvider
public void setJobPriorityProvider(ParameterValueProvider jobPriorityProvider)
-
-