@Override public void performRuntime(final OperationContext context, final HandlerConfiguration configuration, final String name, final ModelNode model) throws OperationFailedException { // Get the handler name final String handlerName = HANDLER_NAME.resolveModelAttribute(context, model).asString(); if (name.equals(handlerName)) { throw createOperationFailure(LoggingMessages.MESSAGES.cannotAddHandlerToSelf(configuration.getName())); } if (configuration.getHandlerNames().contains(handlerName)) { throw createOperationFailure(LoggingMessages.MESSAGES.handlerAlreadyDefined(handlerName)); } configuration.addHandlerName(handlerName); } };
@Override public void performRuntime(final OperationContext context, final ModelNode operation, final ModelNode model, final LogContextConfiguration logContextConfiguration) throws OperationFailedException { final String name = context.getCurrentAddressValue(); final HandlerConfiguration configuration = logContextConfiguration.getHandlerConfiguration(name); if (configuration == null) { throw createOperationFailure(LoggingLogger.ROOT_LOGGER.handlerConfigurationNotFound(name)); } // Get the handler name, uses the operation to get the single handler name being added final String handlerName = HANDLER_NAME.resolveModelAttribute(context, operation).asString(); if (name.equals(handlerName)) { throw createOperationFailure(LoggingLogger.ROOT_LOGGER.cannotAddHandlerToSelf(configuration.getName())); } if (configuration.getHandlerNames().contains(handlerName)) { LoggingLogger.ROOT_LOGGER.tracef("Handler %s is already assigned to handler %s", handlerName, handlerName); } else { configuration.addHandlerName(handlerName); } } };
@Override public void performRuntime(final OperationContext context, final ModelNode operation, final ModelNode model, final LogContextConfiguration logContextConfiguration) throws OperationFailedException { final String name = context.getCurrentAddressValue(); final HandlerConfiguration configuration = logContextConfiguration.getHandlerConfiguration(name); if (configuration == null) { throw createOperationFailure(LoggingLogger.ROOT_LOGGER.handlerConfigurationNotFound(name)); } // Get the handler name, uses the operation to get the single handler name being added final String handlerName = HANDLER_NAME.resolveModelAttribute(context, operation).asString(); if (name.equals(handlerName)) { throw createOperationFailure(LoggingLogger.ROOT_LOGGER.cannotAddHandlerToSelf(configuration.getName())); } if (configuration.getHandlerNames().contains(handlerName)) { LoggingLogger.ROOT_LOGGER.tracef("Handler %s is already assigned to handler %s", handlerName, handlerName); } else { configuration.addHandlerName(handlerName); } } };
for (String name : handlerNames) { if (configureHandler(properties, name)) { configuration.addHandlerName(name);