@Override protected void finishModelStage(final OperationContext context, final ModelNode operation, final String attributeName, final ModelNode newValue, final ModelNode oldValue, final Resource model) throws OperationFailedException { super.finishModelStage(context, operation, attributeName, newValue, oldValue, model); // If a filter attribute, update the filter-spec attribute if (CommonAttributes.FILTER.getName().equals(attributeName)) { final String filterSpec = Filters.filterToFilterSpec(newValue); final ModelNode filterSpecValue = (filterSpec.isEmpty() ? new ModelNode() : new ModelNode(filterSpec)); // Undefine the filter-spec model.getModel().get(CommonAttributes.FILTER_SPEC.getName()).set(filterSpecValue); } } }
@Override protected final boolean applyUpdateToRuntime(final OperationContext context, final ModelNode operation, final String attributeName, final ModelNode resolvedValue, final ModelNode currentValue, final HandbackHolder<ConfigurationPersistence> handbackHolder) throws OperationFailedException { final String name = getAddressName(operation); final PathAddress address = getAddress(operation); final ConfigurationPersistence configurationPersistence; final boolean isLoggingProfile = LoggingProfileOperations.isLoggingProfileAddress(address); if (isLoggingProfile) { final LogContext logContext = LoggingProfileContextSelector.getInstance().getOrCreate(LoggingProfileOperations.getLoggingProfileName(address)); configurationPersistence = ConfigurationPersistence.getOrCreateConfigurationPersistence(logContext); } else { configurationPersistence = ConfigurationPersistence.getOrCreateConfigurationPersistence(); } final LogContextConfiguration logContextConfiguration = configurationPersistence.getLogContextConfiguration(); handbackHolder.setHandback(configurationPersistence); final boolean restartRequired = applyUpdate(context, attributeName, name, resolvedValue, logContextConfiguration); addCommitStep(context, configurationPersistence); return restartRequired; }
@Override protected final boolean applyUpdateToRuntime(final OperationContext context, final ModelNode operation, final String attributeName, final ModelNode resolvedValue, final ModelNode currentValue, final HandbackHolder<ConfigurationPersistence> handbackHolder) throws OperationFailedException { final String name = context.getCurrentAddressValue(); final ConfigurationPersistence configurationPersistence = getOrCreateConfigurationPersistence(context); final LogContextConfiguration logContextConfiguration = configurationPersistence.getLogContextConfiguration(); handbackHolder.setHandback(configurationPersistence); final boolean restartRequired = applyUpdate(context, attributeName, name, resolvedValue, logContextConfiguration); addCommitStep(context, configurationPersistence); final OperationStepHandler afterCommit = afterCommit(logContextConfiguration, attributeName, resolvedValue, currentValue); if (afterCommit != null && !restartRequired) { context.addStep(afterCommit, Stage.RUNTIME); } return restartRequired; }
@Override protected void finishModelStage(final OperationContext context, final ModelNode operation, final String attributeName, final ModelNode newValue, final ModelNode oldValue, final Resource model) throws OperationFailedException { super.finishModelStage(context, operation, attributeName, newValue, oldValue, model); // If a filter attribute, update the filter-spec attribute if (CommonAttributes.FILTER.getName().equals(attributeName)) { final String filterSpec = Filters.filterToFilterSpec(newValue); final ModelNode filterSpecValue = (filterSpec.isEmpty() ? new ModelNode() : new ModelNode(filterSpec)); // Undefine the filter-spec model.getModel().get(CommonAttributes.FILTER_SPEC.getName()).set(filterSpecValue); } } }
@Override protected final boolean applyUpdateToRuntime(final OperationContext context, final ModelNode operation, final String attributeName, final ModelNode resolvedValue, final ModelNode currentValue, final HandbackHolder<ConfigurationPersistence> handbackHolder) throws OperationFailedException { final String name = context.getCurrentAddressValue(); final ConfigurationPersistence configurationPersistence = getOrCreateConfigurationPersistence(context); final LogContextConfiguration logContextConfiguration = configurationPersistence.getLogContextConfiguration(); handbackHolder.setHandback(configurationPersistence); final boolean restartRequired = applyUpdate(context, attributeName, name, resolvedValue, logContextConfiguration); addCommitStep(context, configurationPersistence); final OperationStepHandler afterCommit = afterCommit(logContextConfiguration, attributeName, resolvedValue, currentValue); if (afterCommit != null && !restartRequired) { context.addStep(afterCommit, Stage.RUNTIME); } return restartRequired; }
@Override protected void finishModelStage(final OperationContext context, final ModelNode operation, final String attributeName, final ModelNode newValue, final ModelNode oldValue, final Resource model) throws OperationFailedException { super.finishModelStage(context, operation, attributeName, newValue, oldValue, model); // If a filter attribute, update the filter-spec attribute if (CommonAttributes.FILTER.getName().equals(attributeName)) { final String filterSpec = Filters.filterToFilterSpec(newValue); final ModelNode filterSpecValue = (filterSpec.isEmpty() ? new ModelNode() : new ModelNode(filterSpec)); // Undefine the filter-spec model.getModel().get(CommonAttributes.FILTER_SPEC.getName()).set(filterSpecValue); } } }
@Override protected void finishModelStage(final OperationContext context, final ModelNode operation, final String attributeName, final ModelNode newValue, final ModelNode oldValue, final Resource model) throws OperationFailedException { super.finishModelStage(context, operation, attributeName, newValue, oldValue, model); // If a filter attribute, update the filter-spec attribute if (CommonAttributes.FILTER.getName().equals(attributeName)) { final String filterSpec = Filters.filterToFilterSpec(newValue); final ModelNode filterSpecValue = (filterSpec.isEmpty() ? new ModelNode() : new ModelNode(filterSpec)); // Undefine the filter-spec model.getModel().get(CommonAttributes.FILTER_SPEC.getName()).set(filterSpecValue); } } }