public abstract class RestartParentResourceHandlerBase extends Object implements OperationStepHandler
| Modifier | Constructor and Description |
|---|---|
protected |
RestartParentResourceHandlerBase(String parentKeyName) |
| Modifier and Type | Method and Description |
|---|---|
void |
execute(OperationContext context,
org.jboss.dmr.ModelNode operation)
Execute this step.
|
protected PathAddress |
getParentAddress(PathAddress address) |
protected abstract org.jboss.msc.service.ServiceName |
getParentServiceName(PathAddress parentAddress)
Gets the name of the parent service.
|
protected boolean |
isResourceServiceRestartAllowed(OperationContext context,
org.jboss.msc.service.ServiceController<?> service)
Gets whether a restart of the parent resource's services is allowed.
|
protected abstract void |
recreateParentService(OperationContext context,
PathAddress parentAddress,
org.jboss.dmr.ModelNode parentModel,
ServiceVerificationHandler verificationHandler)
Recreate the parent service(s) using the given model.
|
protected void |
removeServices(OperationContext context,
org.jboss.msc.service.ServiceName parentService,
org.jboss.dmr.ModelNode parentModel)
Removes services.
|
protected boolean |
requiresRuntime(OperationContext context)
Gets whether this operation needs to update the runtime.
|
protected abstract void |
updateModel(OperationContext context,
org.jboss.dmr.ModelNode operation)
Performs the update to the persistent configuration model.
|
protected RestartParentResourceHandlerBase(String parentKeyName)
public void execute(OperationContext context, org.jboss.dmr.ModelNode operation) throws OperationFailedException
OperationStepHandlercontext.getFailureDescription()
must be called, before calling one of the
context.completeStep variants,
or an OperationFailedException must be thrown.
If the operation succeeded, context.getResult() should
be called and the result populated with the outcome, after which one of the
context.completeStep variants
must be called.
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.
execute in interface OperationStepHandlercontext - the operation contextoperation - the operation being executedOperationFailedException - if the operation failed before calling context.completeStep()protected boolean requiresRuntime(OperationContext context)
true
if the process type is not ProcessType.HOST_CONTROLLER.context - the operation contexttrue if the operation should update the runtime; false if it only updates the configuration
modelprotected boolean isResourceServiceRestartAllowed(OperationContext context, org.jboss.msc.service.ServiceController<?> service)
the context allows resource service restarts;
subclasses could also check the state of the service.context - the operation contextservice - the parent servicetrue if a restart is allowed; falseprotected void removeServices(OperationContext context, org.jboss.msc.service.ServiceName parentService, org.jboss.dmr.ModelNode parentModel) throws OperationFailedException
instructs the context to remove the parentService.
Subclasses could use the provided parentModel to identify and remove other services.context - the operation contextparentService - the name of the parent serviceparentModel - the model associated with the parent resource, including nodes for any child resourcesOperationFailedException - if there is a problem removing the servicesprotected abstract void updateModel(OperationContext context, org.jboss.dmr.ModelNode operation) throws OperationFailedException
context - the operation contextoperation - the operationOperationFailedException - if there is a problem updating the modelprotected abstract void recreateParentService(OperationContext context, PathAddress parentAddress, org.jboss.dmr.ModelNode parentModel, ServiceVerificationHandler verificationHandler) throws OperationFailedException
context - the operation contextparentAddress - the address of the parent resourceparentModel - the current configuration model for the parent resource and its childrenverificationHandler - handler for verifying newly installed servicesOperationFailedException - if there is a problem installing the servicesprotected abstract org.jboss.msc.service.ServiceName getParentServiceName(PathAddress parentAddress)
parentAddress - the address of the parent resourceprotected PathAddress getParentAddress(PathAddress address)
Copyright © 2014 JBoss by Red Hat. All rights reserved.