Package org.jboss.msc.service

Examples of org.jboss.msc.service.ServiceName


     * <p/>
     * The {@link ServiceModuleLoader} cannot load these modules.
     */
    @Override
    public void addModule(final Module module) {
        ServiceName moduleServiceName = getModuleServiceName(module.getIdentifier());
        if (serviceContainer.getService(moduleServiceName) == null) {
            ROOT_LOGGER.debugf("Add module to loader: %s", module.getIdentifier());
            serviceTarget.addService(moduleServiceName, new ValueService<Module>(new ImmediateValue<Module>(module))).install();
        }
    }
View Full Code Here


    /**
     * Remove the {@link Module} and {@link ModuleSpec} services assocaiated with the given identifier.
     */
    @Override
    public void removeModule(ModuleIdentifier identifier) {
        ServiceName serviceName = getModuleSpecServiceName(identifier);
        ServiceController<?> controller = serviceContainer.getService(serviceName);
        if (controller != null) {
            ROOT_LOGGER.debugf("Remove module spec fom loader: %s", serviceName);
            controller.setMode(Mode.REMOVE);
        }
View Full Code Here

                throw MESSAGES.cannotFindBundleDir(bundlesDir);

            injectedSubsystemState.getValue().addObserver(this);

            for (OSGiModule moduleMetaData : injectedSubsystemState.getValue().getModules()) {
                ServiceName serviceName = installModule(bundleManager, moduleMetaData);
                pendingServices.put(serviceName, moduleMetaData);
            }

            // Install a service that has a dependency on all pending bundle INSTALLED services
            ServiceName servicesInstalled = Services.AUTOINSTALL_PROVIDER.append("INSTALLED");
            ServiceBuilder<Void> builder = serviceTarget.addService(servicesInstalled, new AbstractService<Void>() {
                public void start(StartContext context) throws StartException {
                    ROOT_LOGGER.debugf("Auto bundles installed");
                }
            });
View Full Code Here

        if (!event.isRemoved()) {
            try {
                for (final OSGiModule module : injectedSubsystemState.getValue().getModules()) {
                    if (module.getIdentifier().toString().equals(event.getId())) {
                        final ServiceName serviceName = installModule(injectedBundleManager.getValue(), module);

                        ServiceBuilder<Void> builder = serviceController.getServiceContainer().addService(
                                ServiceName.of(Services.AUTOINSTALL_PROVIDER, "ModuleUpdater", "" + updateServiceIdCounter.incrementAndGet()),
                                new AbstractService<Void>() {
                                    @Override
View Full Code Here

        if (context.getRuntimeContext() != null) {
            context.getRuntimeContext().setRuntimeTask(new RuntimeTask() {
                public void execute(RuntimeTaskContext context) throws OperationFailedException {
                    final JMSTopicService service = new JMSTopicService(name, jndiBindings(operation));
                    final ServiceName serviceName = JMSServices.JMS_TOPIC_BASE.append(name);
                    context.getServiceTarget().addService(serviceName, service)
                            .addDependency(JMSServices.JMS_MANAGER, JMSServerManager.class, service.getJmsServer())
                            .setInitialMode(Mode.ACTIVE)
                            .install();
                    resultHandler.handleResultComplete();
View Full Code Here

        ServiceBuilder builder = serviceTarget.addService(MasterDomainControllerClient.SERVICE_NAME, service)
                .addDependency(ManagementRemotingServices.MANAGEMENT_ENDPOINT, Endpoint.class, service.endpointInjector)
                .setInitialMode(ServiceController.Mode.ACTIVE);

        if (securityRealm != null) {
            ServiceName callbackHandlerService = SecurityRealmService.BASE_SERVICE_NAME.append(securityRealm).append(SecretIdentityService.SERVICE_SUFFIX);
            builder.addDependency(callbackHandlerService, CallbackHandlerFactory.class, service.callbackFactoryInjector);
        }

        builder.install();
        return service.futureClient;
View Full Code Here

        // Install the process controller client
        final ProcessControllerConnectionService processControllerClient = new ProcessControllerConnectionService(environment, authCode);
        serviceTarget.addService(ProcessControllerConnectionService.SERVICE_NAME, processControllerClient).install();

        // Thread Factory and Executor Services
        final ServiceName threadFactoryServiceName = SERVICE_NAME_BASE.append("thread-factory");
        final ServiceName executorServiceName = SERVICE_NAME_BASE.append("executor");

        serviceTarget.addService(threadFactoryServiceName, new ThreadFactoryService()).install();
        final HostControllerExecutorService executorService = new HostControllerExecutorService();
        serviceTarget.addService(executorServiceName, executorService)
                .addDependency(threadFactoryServiceName, ThreadFactory.class, executorService.threadFactoryValue)
View Full Code Here

                    // Proccess acceptors and connectors
                    final Set<String> socketBindings = new HashSet<String>();
                    processAcceptors(configuration, operation, socketBindings);
                    processConnectors(configuration, operation, socketBindings);
                    for (final String socketBinding : socketBindings) {
                        final ServiceName socketName = SocketBinding.JBOSS_BINDING_NAME.append(socketBinding);
                        serviceBuilder.addDependency(socketName, SocketBinding.class, hqService.getSocketBindingInjector(socketBinding));
                    }
                    hqService.setConfiguration(configuration);

                    // Install the HornetQ Service
View Full Code Here

     * @param path the detyped path element
     * @param serviceTarget the service target
     * @return the created service name
     */
    static ServiceName createDirectoryService(final String name, final ModelNode path, final ServiceTarget serviceTarget) {
        final ServiceName serviceName = PATH_BASE.append(name);
        final String relativeTo = path.hasDefined(RELATIVE_TO) ? path.get(RELATIVE_TO).asString() : DEFAULT_RELATIVE_TO;
        final String pathName = path.hasDefined(PATH) ? path.get(PATH).asString() : DEFAULT_PATH + name;
        RelativePathService.addService(serviceName, pathName, relativeTo, serviceTarget);
        return serviceName;
    }
View Full Code Here

        if (context.getRuntimeContext() != null) {
            context.getRuntimeContext().setRuntimeTask(new RuntimeTask() {
                public void execute(RuntimeTaskContext context) throws OperationFailedException {
                    final ConnectionFactoryConfiguration configuration = createConfiguration(name, operation);
                    final ConnectionFactoryService service = new ConnectionFactoryService(configuration);
                    final ServiceName serviceName = JMSServices.JMS_CF_BASE.append(name);
                    context.getServiceTarget().addService(serviceName, service)
                            .addDependency(JMSServices.JMS_MANAGER, JMSServerManager.class, service.getJmsServer())
                            .setInitialMode(Mode.ACTIVE)
                            .install();
                    resultHandler.handleResultComplete();
View Full Code Here

TOP

Related Classes of org.jboss.msc.service.ServiceName

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.