Package org.jboss.as.controller
Class ServiceRemoveStepHandler
java.lang.Object
org.jboss.as.controller.AbstractRemoveStepHandler
org.jboss.as.controller.ServiceRemoveStepHandler
- All Implemented Interfaces:
OperationStepHandler
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 Summary
ConstructorsConstructorDescriptionServiceRemoveStepHandler(AbstractAddStepHandler addOperation) Creates aServiceRemoveStepHandler.ServiceRemoveStepHandler(org.jboss.msc.service.ServiceName baseServiceName, AbstractAddStepHandler addOperation) Creates aServiceRemoveStepHandler. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidperformRuntime(OperationContext context, org.jboss.dmr.ModelNode operation, org.jboss.dmr.ModelNode model) If thecontext allows resource removal, removes services; otherwise puts the process in reload-required state.protected voidrecoverServices(OperationContext context, org.jboss.dmr.ModelNode operation, org.jboss.dmr.ModelNode model) If thecontext allows resource removal, attempts to restore services by invoking theperformRuntimemethod on the @{code addOperation} handler passed to the constructor; otherwise puts the process in reload-required state.protected booleanrequiresRuntime(OperationContext context) Is a runtime step required?protected org.jboss.msc.service.ServiceNameserviceName(String name) The service name to be removed.protected org.jboss.msc.service.ServiceNameserviceName(String name, PathAddress address) The service name to be removed.Methods inherited from class org.jboss.as.controller.AbstractRemoveStepHandler
execute, performRemove, recordCapabilitiesAndRequirements, removeChildRecursively
-
Constructor Details
-
ServiceRemoveStepHandler
public ServiceRemoveStepHandler(org.jboss.msc.service.ServiceName baseServiceName, AbstractAddStepHandler addOperation) Creates aServiceRemoveStepHandler.- Parameters:
baseServiceName- base name to remove. Cannot benulladdOperation- the add operation to use to rollback service removal. Cannot benull
-
ServiceRemoveStepHandler
Creates aServiceRemoveStepHandler.- Parameters:
addOperation- the add operation to use to rollback service removal. Cannot benull
-
-
Method Details
-
performRuntime
protected void performRuntime(OperationContext context, org.jboss.dmr.ModelNode operation, org.jboss.dmr.ModelNode model) If thecontext 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
unavailableCapabilitiespassed to the constructor.
- Overrides:
performRuntimein classAbstractRemoveStepHandler
- The service named by the value returned from
-
requiresRuntime
Is a runtime step required? By default his method delegates to the suppliedAbstractAddStepHandler, if the add handler required a runtime step then most likely the remove step handler will also require one.- Overrides:
requiresRuntimein classAbstractRemoveStepHandler- See Also:
-
serviceName
The service name to be removed. Can be overridden for unusual service naming patterns- Parameters:
name- The name of the resource being removedaddress- The address of the resource being removed- Returns:
- The service name to remove. May return
nullif only removal based onunavailableCapabilitiespassed to the constructor are to be performed
-
serviceName
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
nullif only removal based onunavailableCapabilitiespassed 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 thecontext allows resource removal, attempts to restore services by invoking theperformRuntimemethod on the @{code addOperation} handler passed to the constructor; otherwise puts the process in reload-required state.- Overrides:
recoverServicesin classAbstractRemoveStepHandler- Throws:
OperationFailedException
-