Package org.jboss.as.controller
Class ReloadRequiredWriteAttributeHandler
- java.lang.Object
-
- org.jboss.as.controller.AbstractWriteAttributeHandler<Void>
-
- org.jboss.as.controller.ReloadRequiredWriteAttributeHandler
-
- All Implemented Interfaces:
OperationStepHandler
- Direct Known Subclasses:
CredentialReferenceWriteAttributeHandler
public class ReloadRequiredWriteAttributeHandler extends AbstractWriteAttributeHandler<Void>
SimpleAbstractWriteAttributeHandler
that triggers putting the process in a restart-required state if attribute that has flagAttributeAccess.Flag.RESTART_JVM
otherwise it puts process in reload-required state.- Author:
- Brian Stansberry (c) 2011 Red Hat Inc.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jboss.as.controller.AbstractWriteAttributeHandler
AbstractWriteAttributeHandler.HandbackHolder<T>
-
-
Constructor Summary
Constructors Constructor Description ReloadRequiredWriteAttributeHandler(Collection<AttributeDefinition> definitions)
ReloadRequiredWriteAttributeHandler(AttributeDefinition... definitions)
-
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> voidHandback)
Hook to allow subclasses to make runtime changes to effect the attribute value change.protected void
revertUpdateToRuntime(OperationContext context, org.jboss.dmr.ModelNode operation, String attributeName, org.jboss.dmr.ModelNode valueToRestore, org.jboss.dmr.ModelNode resolvedValue, 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, requiresRuntime, validateUpdatedModel
-
-
-
-
Constructor Detail
-
ReloadRequiredWriteAttributeHandler
public ReloadRequiredWriteAttributeHandler(AttributeDefinition... definitions)
-
ReloadRequiredWriteAttributeHandler
public ReloadRequiredWriteAttributeHandler(Collection<AttributeDefinition> definitions)
-
-
Method Detail
-
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> voidHandback) 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 attributevoidHandback
- 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 resolvedValue, 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 executedresolvedValue
- the new value for the attribute that should be revertedhandback
- an object, if any, passed in to thehandbackHolder
by theapplyUpdateToRuntime
implementation- Throws:
OperationFailedException
-
-