Package org.jboss.as.controller
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 operationsAbstractAddStepHandler.performRuntime(OperationContext, org.jboss.dmr.ModelNode, org.jboss.dmr.ModelNode)
method.- Author:
- Stuart Douglas
-
-
Constructor Summary
Constructors Constructor Description ServiceRemoveStepHandler(AbstractAddStepHandler addOperation)
Creates aServiceRemoveStepHandler
.ServiceRemoveStepHandler(org.jboss.msc.service.ServiceName baseServiceName, AbstractAddStepHandler addOperation)
Creates aServiceRemoveStepHandler
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.protected void
recoverServices(OperationContext context, org.jboss.dmr.ModelNode operation, org.jboss.dmr.ModelNode model)
If thecontext allows resource removal
, attempts to restore services by invoking theperformRuntime
method on the @{code addOperation} handler passed to the constructor; otherwise puts the process in reload-required state.protected boolean
requiresRuntime(OperationContext context)
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.protected org.jboss.msc.service.ServiceName
serviceName(String name)
The service name to be removed.protected org.jboss.msc.service.ServiceName
serviceName(String name, PathAddress address)
The service name to be removed.-
Methods inherited from class org.jboss.as.controller.AbstractRemoveStepHandler
execute, performRemove, recordCapabilitiesAndRequirements, removeChildRecursively
-
-
-
-
Constructor Detail
-
ServiceRemoveStepHandler
public ServiceRemoveStepHandler(org.jboss.msc.service.ServiceName baseServiceName, AbstractAddStepHandler addOperation)
Creates aServiceRemoveStepHandler
.- Parameters:
baseServiceName
- base name to remove. Cannot benull
addOperation
- the add operation to use to rollback service removal. Cannot benull
-
ServiceRemoveStepHandler
public ServiceRemoveStepHandler(AbstractAddStepHandler addOperation)
Creates aServiceRemoveStepHandler
.- Parameters:
addOperation
- the add operation to use to rollback service removal. Cannot benull
-
-
Method Detail
-
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
unavailableCapabilities
passed to the constructor.
- Overrides:
performRuntime
in classAbstractRemoveStepHandler
- The service named by the value returned from
-
requiresRuntime
protected boolean requiresRuntime(OperationContext context)
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:
requiresRuntime
in classAbstractRemoveStepHandler
- See Also:
AbstractRemoveStepHandler.requiresRuntime(org.jboss.as.controller.OperationContext)
-
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 removedaddress
- The address of the resource being removed- Returns:
- The service name to remove. May return
null
if only removal based onunavailableCapabilities
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 onunavailableCapabilities
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 thecontext allows resource removal
, attempts to restore services by invoking theperformRuntime
method on the @{code addOperation} handler passed to the constructor; otherwise puts the process in reload-required state.- Overrides:
recoverServices
in classAbstractRemoveStepHandler
- Throws:
OperationFailedException
-
-