public class NativeManagementWriteAttributeHandler extends AbstractWriteAttributeHandler<Void>
OperationStepHandler
for changing attributes on the native management interface.AbstractWriteAttributeHandler.HandbackHolder<T>
Modifier and Type | Field and Description |
---|---|
static OperationStepHandler |
INSTANCE |
Modifier and Type | Method and 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.
|
void |
execute(OperationContext context,
org.jboss.dmr.ModelNode operation)
Execute this step.
|
protected boolean |
requiresRuntime(OperationContext context)
Gets whether a
OperationContext.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 in
AbstractWriteAttributeHandler.applyUpdateToRuntime(OperationContext, ModelNode, String, ModelNode, ModelNode, HandbackHolder) . |
getAttributeDefinition, validateResolvedValue, validateUnresolvedValue
public static OperationStepHandler INSTANCE
public void execute(OperationContext context, org.jboss.dmr.ModelNode operation) throws OperationFailedException
OperationStepHandler
context.getFailureDescroption()
must be called, or OperationFailedException
must be thrown, before calling context.completeStep()
.
If the operation succeeded, context.getResult()
should
be called and the result populated with the outcome, after which context.completeStep()
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 OperationStepHandler
execute
in class AbstractWriteAttributeHandler<Void>
context
- the operation contextoperation
- the operation being executedOperationFailedException
- if the operation failed before calling context.completeStep()
protected boolean requiresRuntime(OperationContext context)
AbstractWriteAttributeHandler
OperationContext.Stage.RUNTIME
handler should be added.requiresRuntime
in class AbstractWriteAttributeHandler<Void>
context
- operation contexttrue
if a runtime stage handler should be added; false
otherwise.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
AbstractWriteAttributeHandler
applyUpdateToRuntime
in class AbstractWriteAttributeHandler<Void>
context
- the context of the operationoperation
- the operationattributeName
- the name of the attribute being modifiedresolvedValue
- the new value for the attribute, after ModelNode.resolve()
has been called on itcurrentValue
- the existing value for the attributehandbackHolder
- holder for an arbitrary object to pass to
AbstractWriteAttributeHandler.revertUpdateToRuntime(OperationContext, ModelNode, String, ModelNode, ModelNode, Object)
if
the operation needs to be rolled backtrue
if the server requires restart to effect the attribute
value change; false
if notOperationFailedException
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
AbstractWriteAttributeHandler
AbstractWriteAttributeHandler.applyUpdateToRuntime(OperationContext, ModelNode, String, ModelNode, ModelNode, HandbackHolder)
.revertUpdateToRuntime
in class AbstractWriteAttributeHandler<Void>
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 the handbackHolder
by the applyUpdateToRuntime
implementationOperationFailedException
Copyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.