@Override protected boolean applyUpdateToRuntime(OperationContext context, ModelNode operation, String attributeName, ModelNode resolvedValue, ModelNode currentValue, HandbackHolder<Boolean> handbackHolder) throws OperationFailedException { boolean enabled = resolvedValue.asBoolean(); // We don't try and analyze currentValue to see if we were already enabled, as the resolution result // may be different now than it was before (different system props, or vault contents) // Instead we consider the previous setting to be enabled if the service Mode != Mode.NEVER ListenerService listenerService = getListenerService(context); if (listenerService != null) { boolean currentEnabled = listenerService.isEnabled(); handbackHolder.setHandback(currentEnabled); listenerService.setEnabled(enabled); } return false; }
@Override protected boolean applyUpdateToRuntime(OperationContext context, ModelNode operation, String attributeName, ModelNode resolvedValue, ModelNode currentValue, HandbackHolder<Boolean> handbackHolder) throws OperationFailedException { boolean enabled = resolvedValue.asBoolean(); // We don't try and analyze currentValue to see if we were already enabled, as the resolution result // may be different now than it was before (different system props, or vault contents) // Instead we consider the previous setting to be enabled if the service Mode != Mode.NEVER ListenerService listenerService = getListenerService(context); if (listenerService != null) { boolean currentEnabled = listenerService.isEnabled(); handbackHolder.setHandback(currentEnabled); listenerService.setEnabled(enabled); } return false; }
@Override protected boolean applyUpdateToRuntime(OperationContext context, ModelNode operation, String attributeName, ModelNode resolvedValue, ModelNode currentValue, HandbackHolder<Boolean> handbackHolder) throws OperationFailedException { boolean enabled = resolvedValue.asBoolean(); // We don't try and analyze currentValue to see if we were already enabled, as the resolution result // may be different now than it was before (different system props, or vault contents) // Instead we consider the previous setting to be enabled if the service Mode != Mode.NEVER ListenerService listenerService = getListenerService(context); if (listenerService != null) { boolean currentEnabled = listenerService.isEnabled(); handbackHolder.setHandback(currentEnabled); listenerService.setEnabled(enabled); } return false; }