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 forOperationStepHandler
implementations 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 void
execute(OperationContext context, org.jboss.dmr.ModelNode operation)
{@inheritDocprotected void
performRuntime(OperationContext context, org.jboss.dmr.ModelNode operation, Resource resource)
Make any runtime changes necessary to effect the changes indicated by the givenoperation
.protected boolean
requiresRuntime(OperationContext context)
Gets whetherperformRuntime(OperationContext, org.jboss.dmr.ModelNode, org.jboss.as.controller.registry.Resource)
} should be called.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)
.protected void
updateModel(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 void
updateModel(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:
execute
in 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 OperationFailedException
Update 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
- ifoperation
is invalid or populating the model otherwise fails
-
updateModel
protected abstract void updateModel(org.jboss.dmr.ModelNode operation, org.jboss.dmr.ModelNode model) throws OperationFailedException
Update 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
- ifoperation
is 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:
true
ifperformRuntime
should be invoked;false
otherwise.
-
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 givenmodel
parameter 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
- ifoperation
is 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 ofcontrollers
is the same as what was in thenewControllers
parameter passed toperformRuntime()
when that method returned.- Parameters:
context
- the operation contextoperation
- the operation being executedresource
- the resource that corresponds to the address ofoperation
-
-