Package org.jboss.as.controller
Class ModelOnlyWriteAttributeHandler
- java.lang.Object
-
- org.jboss.as.controller.AbstractWriteAttributeHandler<Void>
-
- org.jboss.as.controller.ModelOnlyWriteAttributeHandler
-
- All Implemented Interfaces:
OperationStepHandler
public class ModelOnlyWriteAttributeHandler extends AbstractWriteAttributeHandler<Void>
Awrite-attribute
handler that simply validates the attribute value and stores it in the model.- Author:
- Brian Stansberry (c) 2012 Red Hat Inc.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jboss.as.controller.AbstractWriteAttributeHandler
AbstractWriteAttributeHandler.HandbackHolder<T>
-
-
Field Summary
Fields Modifier and Type Field Description static OperationStepHandler
INSTANCE
-
Constructor Summary
Constructors Modifier Constructor Description protected
ModelOnlyWriteAttributeHandler()
ModelOnlyWriteAttributeHandler(Collection<AttributeDefinition> attributeDefinitions)
Deprecated, for removal: This API element is subject to removal in a future version.UseINSTANCE
instead.ModelOnlyWriteAttributeHandler(AttributeDefinition... attributeDefinitions)
Deprecated, for removal: This API element is subject to removal in a future version.UseINSTANCE
instead.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
applyUpdateToRuntime(OperationContext context, org.jboss.dmr.ModelNode operation, String attributeName, org.jboss.dmr.ModelNode resolvedValue, org.jboss.dmr.ModelNode currentValue, AbstractWriteAttributeHandler.HandbackHolder<Void> handbackHolder)
Hook to allow subclasses to make runtime changes to effect the attribute value change.protected boolean
requiresRuntime(OperationContext context)
Gets whether aOperationContext.Stage.RUNTIME
handler should be added.protected void
revertUpdateToRuntime(OperationContext context, org.jboss.dmr.ModelNode operation, String attributeName, org.jboss.dmr.ModelNode valueToRestore, org.jboss.dmr.ModelNode valueToRevert, Void handback)
Hook to allow subclasses to revert runtime changes made inAbstractWriteAttributeHandler.applyUpdateToRuntime(OperationContext, ModelNode, String, ModelNode, ModelNode, HandbackHolder)
.-
Methods inherited from class org.jboss.as.controller.AbstractWriteAttributeHandler
execute, finishModelStage, getAttributeDefinition, recordCapabilitiesAndRequirements, validateUpdatedModel
-
-
-
-
Field Detail
-
INSTANCE
public static final OperationStepHandler INSTANCE
-
-
Constructor Detail
-
ModelOnlyWriteAttributeHandler
protected ModelOnlyWriteAttributeHandler()
-
ModelOnlyWriteAttributeHandler
@Deprecated(forRemoval=true) public ModelOnlyWriteAttributeHandler(AttributeDefinition... attributeDefinitions)
Deprecated, for removal: This API element is subject to removal in a future version.UseINSTANCE
instead.
-
ModelOnlyWriteAttributeHandler
@Deprecated(forRemoval=true) public ModelOnlyWriteAttributeHandler(Collection<AttributeDefinition> attributeDefinitions)
Deprecated, for removal: This API element is subject to removal in a future version.UseINSTANCE
instead.
-
-
Method Detail
-
requiresRuntime
protected final boolean requiresRuntime(OperationContext context)
Description copied from class:AbstractWriteAttributeHandler
Gets whether aOperationContext.Stage.RUNTIME
handler should be added. This default implementation returns true if the process is anormal server
and the process is notbooting
. The rationale for the latter check is if the process is booting, the resource being modified will have been added as a previous step in the same context, and the Stage.RUNTIME handling for that add will see a model the reflects the changes made by this handler and will apply them to the runtime.- Overrides:
requiresRuntime
in classAbstractWriteAttributeHandler<Void>
- Parameters:
context
- operation context- Returns:
true
if a runtime stage handler should be added;false
otherwise.
-
applyUpdateToRuntime
protected boolean applyUpdateToRuntime(OperationContext context, org.jboss.dmr.ModelNode operation, String attributeName, org.jboss.dmr.ModelNode resolvedValue, org.jboss.dmr.ModelNode currentValue, AbstractWriteAttributeHandler.HandbackHolder<Void> handbackHolder) throws OperationFailedException
Description copied from class:AbstractWriteAttributeHandler
Hook to allow subclasses to make runtime changes to effect the attribute value change.- Specified by:
applyUpdateToRuntime
in classAbstractWriteAttributeHandler<Void>
- Parameters:
context
- the context of the operationoperation
- the operationattributeName
- the name of the attribute being modifiedresolvedValue
- the new value for the attribute, after anyValueExpression
has been resolvedcurrentValue
- the existing value for the attributehandbackHolder
- holder for an arbitrary object to pass toAbstractWriteAttributeHandler.revertUpdateToRuntime(OperationContext, ModelNode, String, ModelNode, ModelNode, Object)
if the operation needs to be rolled back- Returns:
true
if the server requires reload to effect the attribute value change;false
if not- Throws:
OperationFailedException
-
revertUpdateToRuntime
protected void revertUpdateToRuntime(OperationContext context, org.jboss.dmr.ModelNode operation, String attributeName, org.jboss.dmr.ModelNode valueToRestore, org.jboss.dmr.ModelNode valueToRevert, Void handback) throws OperationFailedException
Description copied from class:AbstractWriteAttributeHandler
Hook to allow subclasses to revert runtime changes made inAbstractWriteAttributeHandler.applyUpdateToRuntime(OperationContext, ModelNode, String, ModelNode, ModelNode, HandbackHolder)
.- Specified by:
revertUpdateToRuntime
in classAbstractWriteAttributeHandler<Void>
- Parameters:
context
- the context of the operationoperation
- the operationattributeName
- the name of the attribute being modifiedvalueToRestore
- the previous value for the attribute, before this operation was executedvalueToRevert
- the new value for the attribute that should be revertedhandback
- an object, if any, passed in to thehandbackHolder
by theapplyUpdateToRuntime
implementation- Throws:
OperationFailedException
-
-