Class DeploymentOperation
- java.lang.Object
-
- org.camunda.bpm.container.impl.spi.DeploymentOperation
-
public class DeploymentOperation extends Object
A DeploymentOperation allows bundling multiple deployment steps into a composite operation that succeeds or fails atomically.
The DeploymentOperation is composed of a list of individual steps (
DeploymentOperationStep
). Each step may or may not install new services into the container. If one of the steps fails, the operation makes sure that- all successfully completed steps are notified by calling their
DeploymentOperationStep.cancelOperationStep(DeploymentOperation)
method. - all services installed in the context of the operation are removed from the container.
- Author:
- Daniel Meyer
- all successfully completed steps are notified by calling their
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DeploymentOperation.DeploymentOperationBuilder
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,Object>
attachments
a list of attachments allows to pass state from one operation to anotherprotected DeploymentOperationStep
currentStep
protected List<String>
installedServices
the list of services installed by this operation.protected boolean
isRollbackOnFailure
protected String
name
the name of this composite operationprotected PlatformServiceContainer
serviceContainer
the service containerprotected List<DeploymentOperationStep>
steps
the list of steps that make up this composite operationprotected List<DeploymentOperationStep>
successfulSteps
a list of steps that completed successfully
-
Constructor Summary
Constructors Constructor Description DeploymentOperation(String name, PlatformServiceContainer container, List<DeploymentOperationStep> steps)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAttachment(String name, Object value)
void
addStep(DeploymentOperationStep step)
Add a new atomic step to the composite operation.void
execute()
<S> S
getAttachment(String name)
List<String>
getInstalledServices()
PlatformServiceContainer
getServiceContainer()
protected void
rollbackOperation()
void
serviceAdded(String serviceName)
-
-
-
Field Detail
-
name
protected final String name
the name of this composite operation
-
serviceContainer
protected final PlatformServiceContainer serviceContainer
the service container
-
steps
protected final List<DeploymentOperationStep> steps
the list of steps that make up this composite operation
-
successfulSteps
protected final List<DeploymentOperationStep> successfulSteps
a list of steps that completed successfully
-
installedServices
protected List<String> installedServices
the list of services installed by this operation. TherollbackOperation()
must make sure all these services are removed if the operation fails.
-
attachments
protected Map<String,Object> attachments
a list of attachments allows to pass state from one operation to another
-
isRollbackOnFailure
protected boolean isRollbackOnFailure
-
currentStep
protected DeploymentOperationStep currentStep
-
-
Constructor Detail
-
DeploymentOperation
public DeploymentOperation(String name, PlatformServiceContainer container, List<DeploymentOperationStep> steps)
-
-
Method Detail
-
getAttachment
public <S> S getAttachment(String name)
-
addStep
public void addStep(DeploymentOperationStep step)
Add a new atomic step to the composite operation. If the operation is currently executing a step, the step is added after the current step.
-
serviceAdded
public void serviceAdded(String serviceName)
-
getServiceContainer
public PlatformServiceContainer getServiceContainer()
-
execute
public void execute()
-
rollbackOperation
protected void rollbackOperation()
-
-