コード例 #1
0
 @Override
 protected void doRevertUpdateToRuntime(
     final OperationContext context,
     final ModelNode operation,
     final String attributeName,
     final ModelNode valueToRestore,
     final ModelNode valueToRevert,
     final String handlerName,
     final T handler)
     throws OperationFailedException {
   if (APPEND.getName().equals(attributeName)) {
     handler.setAppend(valueToRestore.asBoolean());
   } else if (AUTOFLUSH.getName().equals(attributeName)) {
     handler.setAutoFlush(valueToRestore.asBoolean());
   } else if (FILE.getName().equals(attributeName)) {
     FileHandlers.revertFileChange(context, valueToRestore, handlerName);
   }
 }
コード例 #2
0
 @Override
 protected boolean doApplyUpdateToRuntime(
     final OperationContext context,
     final ModelNode operation,
     final String attributeName,
     final ModelNode resolvedValue,
     final ModelNode currentValue,
     final String handlerName,
     final T handler)
     throws OperationFailedException {
   boolean requiresRestart = false;
   if (APPEND.getName().equals(attributeName)) {
     handler.setAppend(resolvedValue.asBoolean());
     return true;
   } else if (AUTOFLUSH.getName().equals(attributeName)) {
     handler.setAutoFlush(resolvedValue.asBoolean());
   } else if (FILE.getName().equals(attributeName)) {
     requiresRestart = FileHandlers.changeFile(context, currentValue, resolvedValue, handlerName);
   }
   return requiresRestart;
 }