public abstract class AbstractLogHandlerWriteAttributeHandler<T extends Handler> extends AbstractWriteAttributeHandler<T>
AbstractWriteAttributeHandler.HandbackHolder<T>
Modifier | Constructor and Description |
---|---|
protected |
AbstractLogHandlerWriteAttributeHandler(AttributeDefinition... attributes) |
protected |
AbstractLogHandlerWriteAttributeHandler(Collection<AttributeDefinition> attributes) |
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<T> handbackHolder)
Hook to allow subclasses to make runtime changes to effect the attribute value change.
|
protected abstract boolean |
doApplyUpdateToRuntime(OperationContext context,
org.jboss.dmr.ModelNode operation,
String attributeName,
org.jboss.dmr.ModelNode resolvedValue,
org.jboss.dmr.ModelNode currentValue,
String handlerName,
T handler)
Applies additional runtime attributes for the handler.
|
protected abstract void |
doRevertUpdateToRuntime(OperationContext context,
org.jboss.dmr.ModelNode operation,
String attributeName,
org.jboss.dmr.ModelNode valueToRestore,
org.jboss.dmr.ModelNode valueToRevert,
String handlerName,
T handler)
Reverts updates to the handler.
|
protected AttributeDefinition |
getAttributeDefinition(String attributeName) |
Collection<AttributeDefinition> |
getAttributes()
Returns a collection of attributes used for the write attribute.
|
protected void |
revertUpdateToRuntime(OperationContext context,
org.jboss.dmr.ModelNode operation,
String attributeName,
org.jboss.dmr.ModelNode valueToRestore,
org.jboss.dmr.ModelNode valueToRevert,
T handler)
Hook to allow subclasses to revert runtime changes made in
AbstractWriteAttributeHandler.applyUpdateToRuntime(OperationContext, ModelNode, String, ModelNode, ModelNode, HandbackHolder) . |
protected void |
validateResolvedValue(String name,
org.jboss.dmr.ModelNode value)
If a resolved value validator was passed to the constructor, uses it to validate the value.
|
protected void |
validateUnresolvedValue(String name,
org.jboss.dmr.ModelNode value)
If an unresolved value validator was passed to the constructor, uses it to validate the value.
|
execute, requiresRuntime
protected AbstractLogHandlerWriteAttributeHandler(AttributeDefinition... attributes)
protected AbstractLogHandlerWriteAttributeHandler(Collection<AttributeDefinition> attributes)
protected final boolean applyUpdateToRuntime(OperationContext context, org.jboss.dmr.ModelNode operation, String attributeName, org.jboss.dmr.ModelNode resolvedValue, org.jboss.dmr.ModelNode currentValue, AbstractWriteAttributeHandler.HandbackHolder<T> handbackHolder) throws OperationFailedException
AbstractWriteAttributeHandler
applyUpdateToRuntime
in class AbstractWriteAttributeHandler<T extends Handler>
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 final void revertUpdateToRuntime(OperationContext context, org.jboss.dmr.ModelNode operation, String attributeName, org.jboss.dmr.ModelNode valueToRestore, org.jboss.dmr.ModelNode valueToRevert, T handler) throws OperationFailedException
AbstractWriteAttributeHandler
AbstractWriteAttributeHandler.applyUpdateToRuntime(OperationContext, ModelNode, String, ModelNode, ModelNode, HandbackHolder)
.revertUpdateToRuntime
in class AbstractWriteAttributeHandler<T extends Handler>
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 revertedhandler
- an object, if any, passed in to the handbackHolder
by the applyUpdateToRuntime
implementationOperationFailedException
protected abstract boolean doApplyUpdateToRuntime(OperationContext context, org.jboss.dmr.ModelNode operation, String attributeName, org.jboss.dmr.ModelNode resolvedValue, org.jboss.dmr.ModelNode currentValue, String handlerName, T handler) throws OperationFailedException
context
- the context for the operation.operation
- 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 attributehandlerName
- the name of the handler.handler
- the handler
to apply the changes to.true
if the server requires restart to effect the attribute value change; false
if not.OperationFailedException
- if the operation fails.protected abstract void doRevertUpdateToRuntime(OperationContext context, org.jboss.dmr.ModelNode operation, String attributeName, org.jboss.dmr.ModelNode valueToRestore, org.jboss.dmr.ModelNode valueToRevert, String handlerName, T handler) throws OperationFailedException
context
- the context for the operation.operation
- 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 revertedhandlerName
- the name of the handler.handler
- the handler to apply the changes to.OperationFailedException
- if the operation fails.protected final void validateResolvedValue(String name, org.jboss.dmr.ModelNode value) throws OperationFailedException
AbstractWriteAttributeHandler
validateResolvedValue
in class AbstractWriteAttributeHandler<T extends Handler>
name
- the name of the attribute being updatedvalue
- the resolved valueOperationFailedException
protected final void validateUnresolvedValue(String name, org.jboss.dmr.ModelNode value) throws OperationFailedException
AbstractWriteAttributeHandler
validateUnresolvedValue
in class AbstractWriteAttributeHandler<T extends Handler>
name
- the name of the attribute being updatedvalue
- the unresolved valueOperationFailedException
protected AttributeDefinition getAttributeDefinition(String attributeName)
getAttributeDefinition
in class AbstractWriteAttributeHandler<T extends Handler>
public final Collection<AttributeDefinition> getAttributes()
Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.