Class AbstractRemoveStepHandler
- java.lang.Object
-
- org.jboss.as.controller.AbstractRemoveStepHandler
-
- All Implemented Interfaces:
OperationStepHandler
- Direct Known Subclasses:
ModelOnlyRemoveStepHandler
,ReloadRequiredRemoveStepHandler
,ServiceRemoveStepHandler
public abstract class AbstractRemoveStepHandler extends Object implements OperationStepHandler
Base class for handlers that remove resources.- Author:
- John Bailey
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractRemoveStepHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute(OperationContext context, org.jboss.dmr.ModelNode operation)
Execute this step.protected void
performRemove(OperationContext context, org.jboss.dmr.ModelNode operation, org.jboss.dmr.ModelNode model)
protected void
performRuntime(OperationContext context, org.jboss.dmr.ModelNode operation, org.jboss.dmr.ModelNode model)
protected void
recordCapabilitiesAndRequirements(OperationContext context, org.jboss.dmr.ModelNode operation, Resource resource)
Record any newcapabilities
that are no longer available as a result of this operation, as well as any requirements for other capabilities that no longer exist.protected void
recoverServices(OperationContext context, org.jboss.dmr.ModelNode operation, org.jboss.dmr.ModelNode model)
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.protected boolean
requiresRuntime(OperationContext context)
-
-
-
Method Detail
-
execute
public void execute(OperationContext context, org.jboss.dmr.ModelNode operation) throws OperationFailedException
Description copied from interface:OperationStepHandler
Execute this step. If the operation fails,context.getFailureDescription()
must be called, or anOperationFailedException
must be thrown. If the operation succeeded and the operation provides a return value,context.getResult()
should be called and the result populated with the outcome. If the handler wishes to take further action once the result of the overall operation execution is known, one of thecontext.completeStep variants
should be called to register a callback. The callback will not be invoked if this method throws an exception.When this method is invoked the
thread context classloader
will be set to be the defining class loader of the class that implements this interface.- Specified by:
execute
in interfaceOperationStepHandler
- Parameters:
context
- the operation contextoperation
- the operation being executed- Throws:
OperationFailedException
- if the operation failed before callingcontext.completeStep()
-
performRemove
protected void performRemove(OperationContext context, org.jboss.dmr.ModelNode operation, org.jboss.dmr.ModelNode model) throws OperationFailedException
- Throws:
OperationFailedException
-
recordCapabilitiesAndRequirements
protected void recordCapabilitiesAndRequirements(OperationContext context, org.jboss.dmr.ModelNode operation, Resource resource) throws OperationFailedException
Record any newcapabilities
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 duringOperationContext.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 benull
operation
- the operation that is executing Will not benull
resource
- the resource that will be removed. Will not reflect any updates made byperformRemove(OperationContext, org.jboss.dmr.ModelNode, org.jboss.dmr.ModelNode)
as this method is invoked before that method is. Will not benull
- 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 returnsfalse
then the child resource will simply be discarded along with their parent.NOTE: If a subclass returnsfalse
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, returningfalse
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
-
performRuntime
protected void performRuntime(OperationContext context, org.jboss.dmr.ModelNode operation, org.jboss.dmr.ModelNode model) throws OperationFailedException
- Throws:
OperationFailedException
-
recoverServices
protected void recoverServices(OperationContext context, org.jboss.dmr.ModelNode operation, org.jboss.dmr.ModelNode model) throws OperationFailedException
- Throws:
OperationFailedException
-
requiresRuntime
protected boolean requiresRuntime(OperationContext context)
-
-