Class ServiceRemoveStepHandler

java.lang.Object
org.jboss.as.controller.AbstractRemoveStepHandler
org.jboss.as.controller.ServiceRemoveStepHandler
All Implemented Interfaces:
OperationStepHandler

public class ServiceRemoveStepHandler extends AbstractRemoveStepHandler
Abstract remove step handler that simply removes a service. If the operation is rolled back it delegates the rollback to the corresponding add operations AbstractAddStepHandler.performRuntime(OperationContext, org.jboss.dmr.ModelNode, org.jboss.dmr.ModelNode) method.
Author:
Stuart Douglas
  • Constructor Details

    • ServiceRemoveStepHandler

      public ServiceRemoveStepHandler(org.jboss.msc.service.ServiceName baseServiceName, AbstractAddStepHandler addOperation)
      Creates a ServiceRemoveStepHandler.
      Parameters:
      baseServiceName - base name to remove. Cannot be null
      addOperation - the add operation to use to rollback service removal. Cannot be null
    • ServiceRemoveStepHandler

      public ServiceRemoveStepHandler(AbstractAddStepHandler addOperation)
      Creates a ServiceRemoveStepHandler.
      Parameters:
      addOperation - the add operation to use to rollback service removal. Cannot be null
  • Method Details

    • performRuntime

      protected void performRuntime(OperationContext context, org.jboss.dmr.ModelNode operation, org.jboss.dmr.ModelNode model)
      If the context allows resource removal, removes services; otherwise puts the process in reload-required state. The following services are removed:
      • The service named by the value returned from serviceName(String, PathAddress), if there is one
      • The service names associated with any unavailableCapabilities passed to the constructor.
      Overrides:
      performRuntime in class AbstractRemoveStepHandler
    • requiresRuntime

      protected boolean requiresRuntime(OperationContext context)
      Is a runtime step required? By default his method delegates to the supplied AbstractAddStepHandler, if the add handler required a runtime step then most likely the remove step handler will also require one.
      Overrides:
      requiresRuntime in class AbstractRemoveStepHandler
      See Also:
    • serviceName

      protected org.jboss.msc.service.ServiceName serviceName(String name, PathAddress address)
      The service name to be removed. Can be overridden for unusual service naming patterns
      Parameters:
      name - The name of the resource being removed
      address - The address of the resource being removed
      Returns:
      The service name to remove. May return null if only removal based on unavailableCapabilities passed to the constructor are to be performed
    • serviceName

      protected org.jboss.msc.service.ServiceName serviceName(String name)
      The service name to be removed. Can be overridden for unusual service naming patterns
      Parameters:
      name - The name of the resource being removed
      Returns:
      The service name to remove. May return null if only removal based on unavailableCapabilities passed to the constructor are to be performed
    • recoverServices

      protected void recoverServices(OperationContext context, org.jboss.dmr.ModelNode operation, org.jboss.dmr.ModelNode model) throws OperationFailedException
      If the context allows resource removal, attempts to restore services by invoking the performRuntime method on the @{code addOperation} handler passed to the constructor; otherwise puts the process in reload-required state.
      Overrides:
      recoverServices in class AbstractRemoveStepHandler
      Throws:
      OperationFailedException