Package org.jboss.as.controller
Class AbstractModelUpdateHandler
- java.lang.Object
-
- org.jboss.as.controller.AbstractModelUpdateHandler
-
- All Implemented Interfaces:
OperationStepHandler
- Direct Known Subclasses:
NamespaceAddHandler,SchemaLocationAddHandler
public abstract class AbstractModelUpdateHandler extends Object implements OperationStepHandler
Base class forOperationStepHandlerimplementations for updating an existing managed resource.- Author:
- Emanuel Muckenhuber
-
-
Constructor Summary
Constructors Constructor Description AbstractModelUpdateHandler()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidexecute(OperationContext context, org.jboss.dmr.ModelNode operation){@inheritDocprotected voidperformRuntime(OperationContext context, org.jboss.dmr.ModelNode operation, Resource resource)Make any runtime changes necessary to effect the changes indicated by the givenoperation.protected booleanrequiresRuntime(OperationContext context)Gets whetherperformRuntime(OperationContext, org.jboss.dmr.ModelNode, org.jboss.as.controller.registry.Resource)} should be called.protected voidrollbackRuntime(OperationContext context, org.jboss.dmr.ModelNode operation, Resource resource)Rollback runtime changes made inperformRuntime(OperationContext, org.jboss.dmr.ModelNode, org.jboss.as.controller.registry.Resource).protected voidupdateModel(org.jboss.dmr.ModelNode operation, Resource resource)Update the given resource in the persistent configuration model based on the values in the given operation.protected abstract voidupdateModel(org.jboss.dmr.ModelNode operation, org.jboss.dmr.ModelNode model)Update the given node in the persistent configuration model based on the values in the given operation.
-
-
-
Method Detail
-
execute
public void execute(OperationContext context, org.jboss.dmr.ModelNode operation) throws OperationFailedException
{@inheritDoc- Specified by:
executein interfaceOperationStepHandler- Parameters:
context- the operation contextoperation- the operation being executed- Throws:
OperationFailedException- if the operation failed before callingcontext.completeStep()
-
updateModel
protected void updateModel(org.jboss.dmr.ModelNode operation, Resource resource) throws OperationFailedExceptionUpdate the given resource in the persistent configuration model based on the values in the given operation.- Parameters:
operation- the operationresource- the resource that corresponds to the address ofoperation- Throws:
OperationFailedException- ifoperationis invalid or populating the model otherwise fails
-
updateModel
protected abstract void updateModel(org.jboss.dmr.ModelNode operation, org.jboss.dmr.ModelNode model) throws OperationFailedExceptionUpdate the given node in the persistent configuration model based on the values in the given operation.- Parameters:
operation- the operationmodel- persistent configuration model node that corresponds to the address ofoperation- Throws:
OperationFailedException- ifoperationis invalid or populating the model otherwise fails
-
requiresRuntime
protected boolean requiresRuntime(OperationContext context)
Gets whetherperformRuntime(OperationContext, org.jboss.dmr.ModelNode, org.jboss.as.controller.registry.Resource)} should be called.- Parameters:
context- operation context- Returns:
trueifperformRuntimeshould be invoked;falseotherwise.
-
performRuntime
protected void performRuntime(OperationContext context, org.jboss.dmr.ModelNode operation, Resource resource) throws OperationFailedException
Make any runtime changes necessary to effect the changes indicated by the givenoperation. Executes afterupdateModel(org.jboss.dmr.ModelNode, org.jboss.dmr.ModelNode), so the givenmodelparameter will reflect any changes made in that method.This default implementation does nothing.
- Parameters:
context- the operation contextoperation- the operation being executedresource- the resource that corresponds to the address ofoperation- Throws:
OperationFailedException- ifoperationis invalid or updating the runtime otherwise fails
-
rollbackRuntime
protected void rollbackRuntime(OperationContext context, org.jboss.dmr.ModelNode operation, Resource resource)
Rollback runtime changes made inperformRuntime(OperationContext, org.jboss.dmr.ModelNode, org.jboss.as.controller.registry.Resource).This default implementation removes all services in the given list of
controllers. The contents ofcontrollersis the same as what was in thenewControllersparameter passed toperformRuntime()when that method returned.- Parameters:
context- the operation contextoperation- the operation being executedresource- the resource that corresponds to the address ofoperation
-
-