Package org.jboss.msc.service

Examples of org.jboss.msc.service.ServiceTarget.addService()


        try {
            final PeriodicRotatingFileHandlerService service = new PeriodicRotatingFileHandlerService();
            final ServiceBuilder<Handler> serviceBuilder = serviceTarget.addService(LogServices.handlerName(name), service);
            if (operation.hasDefined(FILE)) {
                final HandlerFileService fileService = new HandlerFileService(operation.get(FILE, PATH).asString());
                final ServiceBuilder<?> fileBuilder = serviceTarget.addService(LogServices.handlerFileName(name), fileService);
                if (operation.get(FILE).hasDefined(CommonAttributes.RELATIVE_TO)) {
                    fileBuilder.addDependency(AbstractPathService.pathNameOf(operation.get(FILE, RELATIVE_TO).asString()), String.class, fileService.getRelativeToInjector());
                }
                fileBuilder.setInitialMode(ServiceController.Mode.ACTIVE).install();
                serviceBuilder.addDependency(LogServices.handlerFileName(name), String.class, service.getFileNameInjector());
View Full Code Here


        super.updateRuntime(context, serviceBuilder, name, service, model);
        final ModelNode file = FILE.resolveModelAttribute(context, model);
        if (file.isDefined()) {
            final ServiceTarget serviceTarget = context.getServiceTarget();
            final HandlerFileService fileService = new HandlerFileService(PATH.resolveModelAttribute(context, file).asString());
            final ServiceBuilder<?> fileBuilder = serviceTarget.addService(LogServices.handlerFileName(name), fileService);
            final ModelNode relativeTo = RELATIVE_TO.resolveModelAttribute(context, file);
            if (relativeTo.isDefined()) {
                fileBuilder.addDependency(AbstractPathService.pathNameOf(relativeTo.asString()), String.class, fileService.getRelativeToInjector());
            }
            fileBuilder.setInitialMode(ServiceController.Mode.ACTIVE).install();
View Full Code Here

        final PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR));
        final String name = address.getLastElement().getValue();

        final ServiceTarget serviceTarget = context.getServiceTarget();
        final T service = createHandlerService(context, model);
        final ServiceBuilder<Handler> serviceBuilder = serviceTarget.addService(LogServices.handlerName(name), service);
        final ModelNode level = LEVEL.resolveModelAttribute(context, model);
        final ModelNode encoding = ENCODING.resolveModelAttribute(context, model);
        final ModelNode formatter = FORMATTER.resolveModelAttribute(context, model);
        final ModelNode filter = FILTER.resolveModelAttribute(context, model);
View Full Code Here

            throw createFailureMessage(MESSAGES.handlerNotFound(handlerName));
        }

        ServiceTarget target = context.getServiceTarget();
        LoggerHandlerService service = new LoggerHandlerService(loggerName);
        ServiceBuilder<Logger> builder = target.addService(LogServices.loggerHandlerName(loggerName, handlerName), service);
        builder.addDependency(LogServices.loggerName(loggerName));
        builder.addDependency(LogServices.handlerName(handlerName), Handler.class, service.getHandlerInjector());
        builder.addListener(verificationHandler);
        newControllers.add(builder.install());
    }
View Full Code Here

            // Install logger service
            final LoggerService service = new LoggerService(name);
            if (level.isDefined()) service.setLevel(ModelParser.parseLevel(level));
            if (useParentHandlers.isDefined()) service.setUseParentHandlers(useParentHandlers.asBoolean());
            if (filter.isDefined()) service.setFilter(ModelParser.parseFilter(context, filter));
            newControllers.add(target.addService(LogServices.loggerName(name), service)
                    .addListener(verificationHandler)
                    .setInitialMode(ServiceController.Mode.ACTIVE)
                    .install());
        } catch (Throwable t) {
            throw new OperationFailedException(new ModelNode().set(t.getLocalizedMessage()));
View Full Code Here

        }
        final ServiceTarget serviceTarget = context.getServiceTarget();
        final ModelNode file = FILE.resolveModelAttribute(context, model);
        if (file.isDefined()) {
            final HandlerFileService fileService = new HandlerFileService(PATH.validateOperation(file).asString());
            final ServiceBuilder<?> fileBuilder = serviceTarget.addService(LogServices.handlerFileName(name), fileService);
            final ModelNode relativeTo = RELATIVE_TO.resolveModelAttribute(context, file);
            if (relativeTo.isDefined()) {
                fileBuilder.addDependency(AbstractPathService.pathNameOf(relativeTo.asString()), String.class, fileService.getRelativeToInjector());
            }
            fileBuilder.setInitialMode(ServiceController.Mode.ACTIVE).install();
View Full Code Here

        final PathAddress address = PathAddress.pathAddress(operation.require(OP_ADDR));
        final String name = address.getLastElement().getValue();

        final ServiceTarget serviceTarget = context.getServiceTarget();
        final HandlerFileService service = new HandlerFileService(PATH.resolveModelAttribute(context, model).asString());
        final ServiceBuilder<String> serviceBuilder = serviceTarget.addService(LogServices.handlerName(name), service);

        final ModelNode relativeTo = RELATIVE_TO.resolveModelAttribute(context, model);
        if (relativeTo.isDefined()) {
            serviceBuilder.addDependency(AbstractPathService.pathNameOf(relativeTo.asString()), String.class, service.getRelativeToInjector());
        }
View Full Code Here

        final ServiceTarget target = context.getServiceTarget();
        try {

            final RootLoggerService service = new RootLoggerService();
            if (level.isDefined()) service.setLevel(ModelParser.parseLevel(level));
            newControllers.add(target.addService(LogServices.loggerName(name), service)
                    .addListener(verificationHandler)
                    .setInitialMode(ServiceController.Mode.ACTIVE)
                    .install());

View Full Code Here

                // this service needs to depend on the transaction recovery service
                // because it can only initialise XTS recovery once the transaction recovery
                // service has initialised the orb layer

                ServiceBuilder<?> xtsServiceBuilder = target.addService(XTSServices.JBOSS_XTS_MAIN, xtsService);
                xtsServiceBuilder
                        .addDependency(TxnServices.JBOSS_TXN_ARJUNA_TRANSACTION_MANAGER);

                // this service needs to depend on JBossWS Config Service to be notified of the JBoss WS config (bind address, port etc)
                xtsServiceBuilder.addDependency(WSServices.CONFIG_SERVICE, ServerConfig.class, xtsService.getWSServerConfig());
View Full Code Here

                // WS-AT / JTA Transaction bridge services:

                final TxBridgeInboundRecoveryService txBridgeInboundRecoveryService = new TxBridgeInboundRecoveryService();
                ServiceBuilder<?> txBridgeInboundRecoveryServiceBuilder =
                        target.addService(XTSServices.JBOSS_XTS_TXBRIDGE_INBOUND_RECOVERY, txBridgeInboundRecoveryService);
                txBridgeInboundRecoveryServiceBuilder.addDependency(XTSServices.JBOSS_XTS_MAIN);

                txBridgeInboundRecoveryServiceBuilder.setInitialMode(Mode.ACTIVE).install();

                final TxBridgeOutboundRecoveryService txBridgeOutboundRecoveryService = new TxBridgeOutboundRecoveryService();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.