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(AbstractAddStepHandler addOperation, RuntimeCapability... unavailableCapabilities)Deprecated.ServiceRemoveStepHandler(org.jboss.msc.service.ServiceName baseServiceName, AbstractAddStepHandler addOperation)Creates aServiceRemoveStepHandler.ServiceRemoveStepHandler(org.jboss.msc.service.ServiceName baseServiceName, AbstractAddStepHandler addOperation, RuntimeCapability... unavailableCapabilities)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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? 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.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, requireNoChildResources
-
-
-
-
Constructor Detail
-
ServiceRemoveStepHandler
@Deprecated public ServiceRemoveStepHandler(org.jboss.msc.service.ServiceName baseServiceName, AbstractAddStepHandler addOperation, RuntimeCapability... unavailableCapabilities)
Deprecated.Creates aServiceRemoveStepHandler.- Parameters:
baseServiceName- base name to remove. Cannot benullunlessunavailableCapabilitiesare providedaddOperation- the add operation to use to rollback service removal. Cannot benullunavailableCapabilities- capabilities that will no longer be available once the remove occurs. Any servicesexposed by the capabilitieswill also be removed
-
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
@Deprecated public ServiceRemoveStepHandler(AbstractAddStepHandler addOperation, RuntimeCapability... unavailableCapabilities)
Deprecated.Creates aServiceRemoveStepHandler.- Parameters:
addOperation- the add operation to use to rollback service removal. Cannot benullunavailableCapabilities- capabilities that will no longer be available once the remove occurs. Any servicesexposed by the capabilitieswill also be removed. Cannot benullor empty.
-
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
unavailableCapabilitiespassed to the constructor.
- Overrides:
performRuntimein 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:
requiresRuntimein 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
nullif only removal based onunavailableCapabilitiespassed 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
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
-
-