Package org.jboss.as.logging.logmanager

Examples of org.jboss.as.logging.logmanager.ConfigurationPersistence


        @Override
        public final void execute(final OperationContext context, final ModelNode operation) throws OperationFailedException {
            // Get the address and the name of the logger or handler
            final PathAddress address = getAddress(operation);
            final String name = getAddressName(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();

            execute(context, operation, name, logContextConfiguration);
            if (context.getProcessType().isServer()) {
                addCommitStep(context, configurationPersistence);
                // Add rollback handler in case rollback is invoked before a commit step is invoked
                context.completeStep(new RollbackHandler() {
                    @Override
                    public void handleRollback(final OperationContext context, final ModelNode operation) {
                        configurationPersistence.rollback();
                    }
                });
            } else {
                context.stepCompleted();
            }
View Full Code Here


        @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;
        }
View Full Code Here

            }
        }, Stage.RUNTIME);

        final Resource resource = context.readResource(PathAddress.EMPTY_ADDRESS);

        final ConfigurationPersistence configurationPersistence = ConfigurationPersistence.getOrCreateConfigurationPersistence();
        final LogContextConfiguration logContextConfiguration = configurationPersistence.getLogContextConfiguration();
        // root logger
        if (!resource.hasChild(RootLoggerResourceDefinition.ROOT_LOGGER_PATH)) {
            LoggingLogger.ROOT_LOGGER.tracef("Removing the root logger configuration.");
            logContextConfiguration.removeLoggerConfiguration(CommonAttributes.ROOT_LOGGER_NAME);
        }
View Full Code Here

TOP

Related Classes of org.jboss.as.logging.logmanager.ConfigurationPersistence

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.