Package org.camunda.bpm.engine.impl.cmd
Class DeployCmd
- java.lang.Object
-
- org.camunda.bpm.engine.impl.cmd.DeployCmd
-
- All Implemented Interfaces:
Serializable
,Command<DeploymentWithDefinitions>
public class DeployCmd extends Object implements Command<DeploymentWithDefinitions>, Serializable
- Author:
- Tom Baeyens, Joram Barrez, Thorben Lindhauer, Daniel Meyer
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected DeploymentBuilderImpl
deploymentBuilder
protected DeploymentHandler
deploymentHandler
-
Constructor Summary
Constructors Constructor Description DeployCmd(DeploymentBuilderImpl deploymentBuilder)
-
Method Summary
-
-
-
Field Detail
-
deploymentBuilder
protected DeploymentBuilderImpl deploymentBuilder
-
deploymentHandler
protected DeploymentHandler deploymentHandler
-
-
Constructor Detail
-
DeployCmd
public DeployCmd(DeploymentBuilderImpl deploymentBuilder)
-
-
Method Detail
-
execute
public DeploymentWithDefinitions execute(CommandContext commandContext)
- Specified by:
execute
in interfaceCommand<DeploymentWithDefinitions>
-
doExecute
protected DeploymentWithDefinitions doExecute(CommandContext commandContext)
-
acquireExclusiveLock
protected void acquireExclusiveLock(CommandContext commandContext)
-
resolveResourcesToDeploy
protected Map<String,ResourceEntity> resolveResourcesToDeploy(CommandContext commandContext, DeploymentEntity candidateDeployment)
-
deploy
protected void deploy(CommandContext commandContext, DeploymentEntity deployment)
-
scheduleProcessDefinitionActivation
protected void scheduleProcessDefinitionActivation(CommandContext commandContext, DeploymentWithDefinitions deployment)
-
registerProcessApplication
protected ProcessApplicationRegistration registerProcessApplication(CommandContext commandContext, DeploymentEntity deploymentToRegister, CandidateDeployment candidateDeployment, Collection ignoredResources)
-
registerWithJobExecutor
protected void registerWithJobExecutor(CommandContext commandContext, Deployment deployment)
-
createUserOperationLog
protected void createUserOperationLog(DeploymentBuilderImpl deploymentBuilder, Deployment deployment, CommandContext commandContext)
-
initDeployment
protected DeploymentEntity initDeployment()
-
setDeploymentName
protected void setDeploymentName(String deploymentId, DeploymentBuilderImpl deploymentBuilder, CommandContext commandContext)
-
addResources
protected void addResources(List<ResourceEntity> resources, DeploymentBuilderImpl deploymentBuilder)
-
getMissingElements
protected List<String> getMissingElements(Set<String> expected, Map<String,?> actual)
-
getResources
protected List<ResourceEntity> getResources(DeploymentBuilderImpl deploymentBuilder, CommandContext commandContext)
-
getResourcesByDeploymentId
protected List<ResourceEntity> getResourcesByDeploymentId(Set<String> deploymentIds, CommandContext commandContext)
-
getResourcesById
protected List<ResourceEntity> getResourcesById(Map<String,Set<String>> resourcesById, CommandContext commandContext)
-
getResourcesByName
protected List<ResourceEntity> getResourcesByName(Map<String,Set<String>> resourcesByName, CommandContext commandContext)
-
getDeployedProcesses
protected List<? extends ProcessDefinition> getDeployedProcesses(CommandContext commandContext, DeploymentWithDefinitions deployment)
-
getProcessDefinitionsFromResources
protected String[] getProcessDefinitionsFromResources(CommandContext commandContext, DeploymentEntity deploymentToRegister, Collection ignoredResources)
-
parseProcessDefinitionKeys
protected Set<String> parseProcessDefinitionKeys(Collection<Resource> resources)
-
getAllDeploymentIds
protected Set<String> getAllDeploymentIds(DeploymentBuilderImpl deploymentBuilder)
-
checkDuplicateResourceName
protected void checkDuplicateResourceName(List<ResourceEntity> resources)
-
checkCreateAndReadDeployments
protected void checkCreateAndReadDeployments(CommandContext commandContext, Set<String> deploymentIds)
-
isBpmnResource
protected boolean isBpmnResource(Resource resourceEntity)
-
isCmmnResource
protected boolean isCmmnResource(Resource resourceEntity)
-
ensureDeploymentsWithIdsExists
protected void ensureDeploymentsWithIdsExists(Set<String> expected, List<DeploymentEntity> actual)
-
ensureResourcesWithIdsExist
protected void ensureResourcesWithIdsExist(String deploymentId, Set<String> expectedIds, List<ResourceEntity> actual)
-
ensureResourcesWithNamesExist
protected void ensureResourcesWithNamesExist(String deploymentId, Set<String> expectedNames, List<ResourceEntity> actual)
-
ensureResourcesWithKeysExist
protected void ensureResourcesWithKeysExist(String deploymentId, Set<String> expectedKeys, Map<String,ResourceEntity> actual, String valueProperty)
-
isRetryable
public boolean isRetryable()
When CockroachDB is used, this command may be retried multiple times until it is successful, or the retries are exhausted. CockroachDB uses a stricter, SERIALIZABLE transaction isolation which ensures a serialized manner of transaction execution. A concurrent transaction that attempts to modify the same data as another transaction is required to abort, rollback and retry. This also makes our use-case of pessimistic locks redundant since we only use them as synchronization barriers, and not to lock actual data which would protect it from concurrent modifications. The Deploy command only executes internal code, so we are certain that a retry of a failed deployment will not impact user data, and may be performed multiple times.- Specified by:
isRetryable
in interfaceCommand<DeploymentWithDefinitions>
- Returns:
- true if the
CrdbTransactionRetryInterceptor
can make a transparent retry of this command upon failure with aCrdbTransactionRetryException
(only used when running on CockroachDB).
-
-