Class DeploymentOperation


  • public class DeploymentOperation
    extends java.lang.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

    Author:
    Daniel Meyer
    • Field Detail

      • name

        protected final java.lang.String name
        the name of this composite operation
      • steps

        protected final java.util.List<DeploymentOperationStep> steps
        the list of steps that make up this composite operation
      • successfulSteps

        protected final java.util.List<DeploymentOperationStep> successfulSteps
        a list of steps that completed successfully
      • installedServices

        protected java.util.List<java.lang.String> installedServices
        the list of services installed by this operation. The rollbackOperation() must make sure all these services are removed if the operation fails.
      • attachments

        protected java.util.Map<java.lang.String,​java.lang.Object> attachments
        a list of attachments allows to pass state from one operation to another
      • isRollbackOnFailure

        protected boolean isRollbackOnFailure
    • Method Detail

      • getAttachment

        public <S> S getAttachment​(java.lang.String name)
      • addAttachment

        public void addAttachment​(java.lang.String name,
                                  java.lang.Object value)
      • 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​(java.lang.String serviceName)
      • execute

        public void execute()
      • rollbackOperation

        protected void rollbackOperation()
      • getInstalledServices

        public java.util.List<java.lang.String> getInstalledServices()