org.camunda.bpm.engine.impl.jobexecutor
Class JobDeclaration<S,T extends JobEntity>

java.lang.Object
  extended by org.camunda.bpm.engine.impl.jobexecutor.JobDeclaration<S,T>
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
EventSubscriptionJobDeclaration, MessageJobDeclaration, TimerDeclarationImpl

public abstract class JobDeclaration<S,T extends JobEntity>
extends Object
implements Serializable

A 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
protected  ActivityImpl activity
           
protected  boolean exclusive
           
protected  String jobConfiguration
           
protected  String jobDefinitionId
          the id of the associated persistent jobDefinitionId
protected  String jobHandlerConfiguration
           
protected  String jobHandlerType
           
protected  ParameterValueProvider jobPriorityProvider
           
 
Constructor Summary
JobDeclaration(String jobHandlerType)
           
 
Method Summary
 T createJobInstance(S context)
           
 ActivityImpl getActivity()
           
 String getActivityId()
           
 String getJobConfiguration()
           
 String getJobDefinitionId()
           
 String getJobHandlerConfiguration()
           
 String getJobHandlerType()
           
 ParameterValueProvider getJobPriorityProvider()
           
 ProcessDefinitionImpl getProcessDefinition()
           
 boolean isExclusive()
           
protected abstract  T newJobInstance(S context)
           
protected  void postInitialize(S context, T job)
          general callback to override any configuration after the defaults have been applied
protected  Date resolveDueDate(S context)
           
protected  boolean resolveExclusive(S context)
           
protected abstract  ExecutionEntity resolveExecution(S context)
           
protected  String resolveJobDefinitionId(S context)
           
protected  String resolveJobHandlerConfiguration(S context)
           
protected  String resolveJobHandlerType(S context)
           
protected  int resolveRetries(S context)
           
 void setActivity(ActivityImpl activity)
           
 void setExclusive(boolean exclusive)
           
 void setJobConfiguration(String jobConfiguration)
           
 void setJobDefinitionId(String jobDefinitionId)
           
 void setJobHandlerConfiguration(String jobHandlerConfiguration)
           
 void setJobHandlerType(String jobHandlerType)
           
 void setJobPriorityProvider(ParameterValueProvider jobPriorityProvider)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

jobDefinitionId

protected String jobDefinitionId
the id of the associated persistent jobDefinitionId


jobHandlerType

protected String jobHandlerType

jobHandlerConfiguration

protected String jobHandlerConfiguration

jobConfiguration

protected String jobConfiguration

exclusive

protected boolean exclusive

activity

protected ActivityImpl activity

jobPriorityProvider

protected ParameterValueProvider jobPriorityProvider
Constructor Detail

JobDeclaration

public JobDeclaration(String jobHandlerType)
Method Detail

createJobInstance

public T createJobInstance(S context)
Parameters:
execution - can be null in case of a timer start event.
Returns:
the created Job instances

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)

newJobInstance

protected abstract T newJobInstance(S context)

getJobDefinitionId

public String getJobDefinitionId()

resolveJobDefinitionId

protected String resolveJobDefinitionId(S context)

setJobDefinitionId

public void setJobDefinitionId(String jobDefinitionId)

getJobHandlerType

public String getJobHandlerType()

resolveJobHandlerType

protected String resolveJobHandlerType(S context)

getJobHandlerConfiguration

public String getJobHandlerConfiguration()

resolveJobHandlerConfiguration

protected String resolveJobHandlerConfiguration(S context)

setJobHandlerConfiguration

public void setJobHandlerConfiguration(String jobHandlerConfiguration)

resolveExclusive

protected boolean resolveExclusive(S context)

resolveRetries

protected int resolveRetries(S context)

resolveDueDate

protected Date resolveDueDate(S context)

isExclusive

public boolean isExclusive()

setExclusive

public void setExclusive(boolean exclusive)

setJobHandlerType

public void setJobHandlerType(String jobHandlerType)

getActivityId

public String getActivityId()

getActivity

public ActivityImpl getActivity()

setActivity

public void setActivity(ActivityImpl activity)

getProcessDefinition

public ProcessDefinitionImpl getProcessDefinition()

getJobConfiguration

public String getJobConfiguration()

setJobConfiguration

public void setJobConfiguration(String jobConfiguration)

getJobPriorityProvider

public ParameterValueProvider getJobPriorityProvider()

setJobPriorityProvider

public void setJobPriorityProvider(ParameterValueProvider jobPriorityProvider)


Copyright © 2015 camunda services GmbH. All rights reserved.