Class AbstractRemoveStepHandler

    • Constructor Detail

      • AbstractRemoveStepHandler

        protected AbstractRemoveStepHandler()
    • Method Detail

      • recordCapabilitiesAndRequirements

        protected void recordCapabilitiesAndRequirements​(OperationContext context,
                                                         org.jboss.dmr.ModelNode operation,
                                                         Resource resource)
                                                  throws OperationFailedException
        Record any new capabilities that are no longer available as a result of this operation, as well as any requirements for other capabilities that no longer exist. This method is invoked during OperationContext.Stage.MODEL.

        Any changes made by this method will automatically be discarded if the operation rolls back.

        This default implementation deregisters any capabilities passed to the constructor.

        Parameters:
        context - the context. Will not be null
        operation - the operation that is executing Will not be null
        resource - the resource that will be removed. Will not reflect any updates made by performRemove(OperationContext, org.jboss.dmr.ModelNode, org.jboss.dmr.ModelNode) as this method is invoked before that method is. Will not be null
        Throws:
        OperationFailedException
      • removeChildRecursively

        protected boolean removeChildRecursively​(PathElement child)
        Gets whether a child resource should be removed via the addition of a step to invoke the "remove" operation for its address. If this method returns false then the child resource will simply be discarded along with their parent.

        NOTE: If a subclass returns false from this method, it must ensure that it itself will make any necessary changes to the capability registry and the service container associated with the child resource. Generally, returning false would only be appropriate for parent resources whose children only represent configuration details of the parent, and are not independent entities.

        This default implementation returns true

        Parameters:
        child - the path element pointing to the child resource
        Returns:
        true if separate steps should be added to remove children; false if any children can simply be discarded along with the parent
      • requiresRuntime

        protected boolean requiresRuntime​(OperationContext context)