Package org.jboss.msc.service

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


        // The update handler
        final UpdateResultHandler.ServiceStartListener<P> listener = new UpdateResultHandler.ServiceStartListener<P>(resultHandler, param);

        // Register the service with the container and inject dependencies.
        final ServiceName connectorName = ConnectorElement.connectorName(name);
        final BatchServiceBuilder<ChannelListener<ConnectedStreamChannel<InetSocketAddress>>> serviceBuilder = batchBuilder.addService(connectorName, connectorService);
        serviceBuilder.addDependency(connectorName.append("auth-provider"), ServerAuthenticationProvider.class, connectorService.getAuthenticationProviderInjector());
        serviceBuilder.addDependency(RemotingSubsystemElement.JBOSS_REMOTING_ENDPOINT, Endpoint.class, connectorService.getEndpointInjector());
        serviceBuilder.addListener(listener);
        serviceBuilder.setInitialMode(ServiceController.Mode.ACTIVE);
View Full Code Here


        final BatchBuilder batchBuilder = updateContext.getBatchBuilder();
        batchBuilder.addServiceValueIfNotExist(DeploymentChainProviderService.SERVICE_NAME, new DeploymentChainProviderService());

        final Value<DeploymentChain> deploymentChainValue = Values.immediateValue((DeploymentChain)new DeploymentChainImpl(SAR_DEPLOYMENT_CHAIN_SERVICE_NAME.toString()))   ;
        final DeploymentChainService deploymentChainService = new DeploymentChainService(deploymentChainValue);
        batchBuilder.addService(SAR_DEPLOYMENT_CHAIN_SERVICE_NAME, deploymentChainService)
            .addDependency(DeploymentChainProviderService.SERVICE_NAME, DeploymentChainProvider.class, new DeploymentChainProviderInjector<DeploymentChain>(deploymentChainValue, new SarDeploymentChainSelector(), SAR_DEPLOYMENT_CHAIN_PRIORITY));

        addDeploymentProcessor(batchBuilder, new ManifestAttachmentProcessor(), ManifestAttachmentProcessor.PRIORITY);
        addDeploymentProcessor(batchBuilder, new ServiceActivatorDependencyProcessor(), ServiceActivatorDependencyProcessor.PRIORITY);
        addDeploymentProcessor(batchBuilder, new ModuleDependencyProcessor(), ModuleDependencyProcessor.PRIORITY);
View Full Code Here

        public void activate(final ServiceActivatorContext serviceActivatorContext) {
            final BatchBuilder batchBuilder = serviceActivatorContext.getBatchBuilder();

            final ServerManagerConnectionService smConnection = new ServerManagerConnectionService();
            batchBuilder.addService(ServerManagerConnectionService.SERVICE_NAME, smConnection)
                .addInjection(smConnection.getSmAddressInjector(), managementSocket)
                .setInitialMode(ServiceController.Mode.ACTIVE);

            final ServerManagerClient client = new ServerManagerClient();
            batchBuilder.addService(ServerManagerClient.SERVICE_NAME, client)
View Full Code Here

            batchBuilder.addService(ServerManagerConnectionService.SERVICE_NAME, smConnection)
                .addInjection(smConnection.getSmAddressInjector(), managementSocket)
                .setInitialMode(ServiceController.Mode.ACTIVE);

            final ServerManagerClient client = new ServerManagerClient();
            batchBuilder.addService(ServerManagerClient.SERVICE_NAME, client)
                .addDependency(ServerManagerConnectionService.SERVICE_NAME, Connection.class, client.getSmConnectionInjector())
                .addDependency(ServerController.SERVICE_NAME, ServerController.class, client.getServerControllerInjector())
                .setInitialMode(ServiceController.Mode.ACTIVE);
        }
    }
View Full Code Here

    protected <P> void applyUpdate(final UpdateContext updateContext, final UpdateResultHandler<? super Void, P> handler, final P param) {
        try {
            final BatchBuilder batchBuilder = updateContext.getBatchBuilder();
            final FileHandlerService service = new FileHandlerService();
            final BatchServiceBuilder<Handler> serviceBuilder = batchBuilder.addService(LogServices.handlerName(getName()), service);
            final String relativeTo = this.relativeTo;
            if (relativeTo != null) {
                serviceBuilder.addDependency(AbstractPathService.pathNameOf(relativeTo), String.class, service.getRelativeToInjector());
            }
            service.setLevel(Level.parse(getLevelName()));
View Full Code Here

    protected <P> void applyUpdate(UpdateContext updateContext, UpdateResultHandler<? super Void, P> resultHandler, P param) {
        try {
            final RootLoggerService service = new RootLoggerService();
            service.setLevel(Level.parse(getLevelName()));
            final BatchBuilder batchBuilder = updateContext.getBatchBuilder();
            final BatchServiceBuilder<Logger> builder = batchBuilder.addService(LogServices.ROOT_LOGGER, service);
            builder.setInitialMode(ServiceController.Mode.ACTIVE);
            builder.addListener(new UpdateResultHandler.ServiceStartListener<P>(resultHandler, param));
        } catch (Throwable t) {
            resultHandler.handleFailure(t, param);
            return;
View Full Code Here

    protected <P> void applyUpdate(final UpdateContext updateContext, final UpdateResultHandler<? super Void, P> handler, final P param) {
        try {
            final BatchBuilder batchBuilder = updateContext.getBatchBuilder();
            final PeriodicRotatingFileHandlerService service = new PeriodicRotatingFileHandlerService();
            final BatchServiceBuilder<Handler> serviceBuilder = batchBuilder.addService(LogServices.handlerName(getName()), service);
            final String relativeTo = getRelativeTo();
            if (relativeTo != null) {
                serviceBuilder.addDependency(AbstractPathService.pathNameOf(relativeTo), String.class, service.getRelativeToInjector());
            }
            service.setLevel(Level.parse(getLevelName()));
View Full Code Here

     */
    protected <P> void applyUpdate(UpdateContext updateContext, UpdateResultHandler<? super Void, P> resultHandler, P param) {
        try {
            final BatchBuilder builder = updateContext.getBatchBuilder();
            final AsyncHandlerService service = new AsyncHandlerService();
            final BatchServiceBuilder<Handler> serviceBuilder = builder.addService(LogServices.handlerName(getName()), service);
            final List<InjectedValue<Handler>> list = new ArrayList<InjectedValue<Handler>>();
            for (String handlerName : getSubhandlers()) {
                final InjectedValue<Handler> injectedValue = new InjectedValue<Handler>();
                serviceBuilder.addDependency(LogServices.handlerName(handlerName), Handler.class, injectedValue);
                list.add(injectedValue);
View Full Code Here

        }

        hqservice.setConfiguration(hqConfig);

        final BatchBuilder batchBuilder = updateContext.getBatchBuilder();
        final BatchServiceBuilder<HornetQServer> serviceBuilder = batchBuilder.addService(MessagingSubsystemElement.JBOSS_MESSAGING, hqservice)
                .addOptionalDependency(ServiceName.JBOSS.append("mbean", "server"), MBeanServer.class, hqservice.getMBeanServer());

        // FIXME move the JMSService into the jms subsystem
        JMSService.addService(batchBuilder);
View Full Code Here

        deployment.addAttachment(ServiceName.class, deploymentServiceName);

        BatchBuilder batchBuilder = context.getBatchBuilder();
        OSGiDeploymentService service = new OSGiDeploymentService(deployment);
        ServiceName serviceName = OSGiDeploymentService.SERVICE_NAME.append(deploymentServiceName.getSimpleName());
        BatchServiceBuilder<Deployment> serviceBuilder = batchBuilder.addService(serviceName, service);
        serviceBuilder.addDependency(FrameworkService.SERVICE_NAME, BundleContext.class, service.injectedContext);
        serviceBuilder.addDependency(PackageAdminService.SERVICE_NAME);
        serviceBuilder.addDependency(deploymentServiceName);
        serviceBuilder.setInitialMode(Mode.ACTIVE);
        if (enableListener)
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.