当前位置: 首页>>代码示例>>Java>>正文


Java ServiceBuilder.setInitialMode方法代码示例

本文整理汇总了Java中org.jboss.msc.service.ServiceBuilder.setInitialMode方法的典型用法代码示例。如果您正苦于以下问题:Java ServiceBuilder.setInitialMode方法的具体用法?Java ServiceBuilder.setInitialMode怎么用?Java ServiceBuilder.setInitialMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jboss.msc.service.ServiceBuilder的用法示例。


在下文中一共展示了ServiceBuilder.setInitialMode方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: performRuntime

import org.jboss.msc.service.ServiceBuilder; //导入方法依赖的package包/类
@Override
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model,
                              ServiceVerificationHandler verificationHandler, List<ServiceController<?>> newControllers) throws OperationFailedException {
    final String moduleId = PathAddress.pathAddress(operation.get(ModelDescriptionConstants.ADDRESS)).getLastElement().getValue();
    _componentNames.add(moduleId);

    context.addStep(new AbstractDeploymentChainStep() {
        protected void execute(DeploymentProcessorTarget processorTarget) {
            processorTarget.addDeploymentProcessor(SwitchYardExtension.SUBSYSTEM_NAME, Phase.DEPENDENCIES, _priority++, new SwitchYardModuleDependencyProcessor(moduleId));
        }
    }, OperationContext.Stage.RUNTIME);

    final SwitchYardComponentService componentService = new SwitchYardComponentService(moduleId, model);
    final ServiceBuilder<Component> componentServiceBuilder = context.getServiceTarget().addService(SwitchYardComponentService.SERVICE_NAME.append(moduleId), componentService);
    componentServiceBuilder.addDependency(SwitchYardInjectorService.SERVICE_NAME, Map.class, componentService.getInjectedValues())
            .addDependency(RA_REPOSITORY_SERVICE_NAME, ResourceAdapterRepository.class, componentService.getResourceAdapterRepository());
    componentServiceBuilder.addDependency(WebSubsystemServices.JBOSS_WEB);
    componentServiceBuilder.setInitialMode(Mode.ACTIVE);
    newControllers.add(componentServiceBuilder.install());
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:21,代码来源:SwitchYardModuleAdd.java

示例2: performRuntime

import org.jboss.msc.service.ServiceBuilder; //导入方法依赖的package包/类
@Override
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException {
    final String moduleId = PathAddress.pathAddress(operation.get(ModelDescriptionConstants.ADDRESS)).getLastElement().getValue();
    _componentNames.add(moduleId);

    context.addStep(new AbstractDeploymentChainStep() {
        protected void execute(DeploymentProcessorTarget processorTarget) {
            processorTarget.addDeploymentProcessor(SwitchYardExtension.SUBSYSTEM_NAME, Phase.DEPENDENCIES, _priority++, new SwitchYardModuleDependencyProcessor(moduleId));
        }
    }, OperationContext.Stage.RUNTIME);

    final SwitchYardComponentService componentService = new SwitchYardComponentService(moduleId, model);
    final ServiceBuilder<Component> componentServiceBuilder = context.getServiceTarget().addService(SwitchYardComponentService.SERVICE_NAME.append(moduleId), componentService);
    componentServiceBuilder.addDependency(SwitchYardInjectorService.SERVICE_NAME, Map.class, componentService.getInjectedValues())
            .addDependency(RA_REPOSITORY_SERVICE_NAME, ResourceAdapterRepository.class, componentService.getResourceAdapterRepository());
    componentServiceBuilder.setInitialMode(Mode.ACTIVE);
    componentServiceBuilder.install();
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:19,代码来源:SwitchYardModuleAdd.java

示例3: install

import org.jboss.msc.service.ServiceBuilder; //导入方法依赖的package包/类
public static ServiceName install(final ServiceTarget target, final ModuleIdentifier identifier, final List<ModuleDependency> dependencies) {
    final ModuleLoadService service = new ModuleLoadService(dependencies);
    final ServiceName serviceName = ServiceModuleLoader.moduleServiceName(identifier);
    final ServiceBuilder<Module> builder = target.addService(serviceName, service);
    builder.addDependency(Services.JBOSS_SERVICE_MODULE_LOADER, ServiceModuleLoader.class, service.getServiceModuleLoader());
    builder.addDependency(ServiceModuleLoader.moduleSpecServiceName(identifier), ModuleDefinition.class, service.getModuleDefinitionInjectedValue());
    builder.addDependency(ServiceModuleLoader.moduleResolvedServiceName(identifier)); //don't attempt to load until all dependent module specs are up, even transitive ones

    for (ModuleDependency dependency : dependencies) {
        final ModuleIdentifier moduleIdentifier = dependency.getIdentifier();
        if (moduleIdentifier.getName().startsWith(ServiceModuleLoader.MODULE_PREFIX)) {
            builder.addDependency(dependency.isOptional() ? OPTIONAL : REQUIRED, ServiceModuleLoader.moduleSpecServiceName(moduleIdentifier));
        }
    }
    builder.setInitialMode(Mode.ON_DEMAND);
    builder.install();
    return serviceName;
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:19,代码来源:ModuleLoadService.java

示例4: performRuntime

import org.jboss.msc.service.ServiceBuilder; //导入方法依赖的package包/类
@Override
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model,
                              ServiceVerificationHandler verificationHandler, List<ServiceController<?>> newControllers) throws OperationFailedException {
    String moduleId = PathAddress.pathAddress(operation.get(ModelDescriptionConstants.ADDRESS)).getLastElement().getValue();
    ServiceName serviceName = SwitchYardSecurityConfigService.SERVICE_NAME.append(moduleId);
    SwitchYardSecurityConfigService securityConfigService = new SwitchYardSecurityConfigService(moduleId, model);
    ServiceBuilder<SecurityConfig> securityConfigServiceBuilder = context.getServiceTarget().addService(serviceName, securityConfigService);
    securityConfigServiceBuilder.addDependency(SwitchYardSystemSecurityService.SERVICE_NAME, SystemSecurity.class, securityConfigService.getSystemSecurity());
    securityConfigServiceBuilder.addDependency(SwitchYardInjectorService.SERVICE_NAME, Map.class, securityConfigService.getInjectedValues());
    securityConfigServiceBuilder.setInitialMode(Mode.ACTIVE);
    newControllers.add(securityConfigServiceBuilder.install());
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:13,代码来源:SwitchYardSecurityConfigAdd.java

示例5: addService

import org.jboss.msc.service.ServiceBuilder; //导入方法依赖的package包/类
public static void addService(final ServiceTarget serviceTarget) {
    ArquillianService service = new ArquillianService();
    ServiceBuilder<?> builder = serviceTarget.addService(ArquillianService.SERVICE_NAME, service);
    builder.addDependency(MBeanServerService.SERVICE_NAME, MBeanServer.class, service.injectedMBeanServer);
    builder.setInitialMode(ServiceController.Mode.ACTIVE);
    builder.install();
}
 
开发者ID:wildfly,项目名称:wildfly-arquillian,代码行数:8,代码来源:ArquillianService.java

示例6: performBoottime

import org.jboss.msc.service.ServiceBuilder; //导入方法依赖的package包/类
@Override
protected void performBoottime(OperationContext context, ModelNode operation, ModelNode model, ServiceVerificationHandler verificationHandler, List<ServiceController<?>> newControllers) throws OperationFailedException {
    LOG.trace("Performing boot time operation " + operation);
    context.addStep(new AbstractDeploymentChainStep() {
        protected void execute(DeploymentProcessorTarget processorTarget) {
            int priority = 0x4000;
            processorTarget.addDeploymentProcessor(SwitchYardExtension.SUBSYSTEM_NAME, Phase.PARSE, priority++, new SwitchYardConfigDeploymentProcessor());
            processorTarget.addDeploymentProcessor(SwitchYardExtension.SUBSYSTEM_NAME, Phase.DEPENDENCIES, priority++, new SwitchYardDependencyProcessor());
            processorTarget.addDeploymentProcessor(SwitchYardExtension.SUBSYSTEM_NAME, Phase.POST_MODULE, priority++, new SwitchYardConfigProcessor());
            processorTarget.addDeploymentProcessor(SwitchYardExtension.SUBSYSTEM_NAME, Phase.INSTALL, priority++, new SwitchYardDeploymentProcessor());
        }
    }, OperationContext.Stage.RUNTIME);
    LOG.trace("Activating SwitchYard Subsystem");

    ServerUtil.setRegistry(context.getServiceRegistry(false));
    final SwitchYardInjectorService injectorService = new SwitchYardInjectorService();
    final ServiceBuilder<Map<String, String>> injectorServiceBuilder = context.getServiceTarget().addService(SwitchYardInjectorService.SERVICE_NAME, injectorService);
    if (model.hasDefined(SOCKET_BINDING)) {
        StringTokenizer sockets = new StringTokenizer(Attributes.SOCKET_BINDING.resolveModelAttribute(context,model).asString(), ",");
        while (sockets.hasMoreTokens()) {
            String socketName = sockets.nextToken();
            injectorServiceBuilder.addDependency(SocketBinding.JBOSS_BINDING_NAME.append(socketName), SocketBinding.class, injectorService.getSocketBinding(socketName));
        }
    }
    injectorServiceBuilder.setInitialMode(Mode.ACTIVE);
    newControllers.add(injectorServiceBuilder.install());

    // Add the AS7 Service for the SystemSecurity...
    final SwitchYardSystemSecurityService systemSecurityService = new SwitchYardSystemSecurityService();
    newControllers.add(context.getServiceTarget()
            .addService(SwitchYardSystemSecurityService.SERVICE_NAME, systemSecurityService)
            .install());

    // Add the AS7 Service for the ServiceDomainManager...
    final SwitchYardServiceDomainManagerService serviceDomainManagerService = new SwitchYardServiceDomainManagerService();
    newControllers.add(context.getServiceTarget()
            .addService(SwitchYardServiceDomainManagerService.SERVICE_NAME, serviceDomainManagerService)
            .addDependency(SwitchYardSystemSecurityService.SERVICE_NAME, SystemSecurity.class, serviceDomainManagerService.getSystemSecurity())
            .addDependency(DependencyType.OPTIONAL, CacheService.getServiceName("cluster", null), Cache.class, serviceDomainManagerService.getCache())
            .install());

    final SwitchYardAdminService adminService = new SwitchYardAdminService();
    final ServiceBuilder<SwitchYard> adminServiceBuilder = context.getServiceTarget().addService(SwitchYardAdminService.SERVICE_NAME, adminService);
    adminServiceBuilder.setInitialMode(Mode.ACTIVE);
    newControllers.add(adminServiceBuilder
            .addDependency(SwitchYardInjectorService.SERVICE_NAME, Map.class, adminService.getSocketBindings())
            .addDependency(SwitchYardServiceDomainManagerService.SERVICE_NAME, ServiceDomainManager.class, adminService.getServiceDomainManager())
            .install());

}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:51,代码来源:SwitchYardSubsystemAdd.java

示例7: performBoottime

import org.jboss.msc.service.ServiceBuilder; //导入方法依赖的package包/类
@Override
protected void performBoottime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException {
    LOG.trace("Performing boot time operation " + operation);
    context.addStep(new AbstractDeploymentChainStep() {
        protected void execute(DeploymentProcessorTarget processorTarget) {
            int priority = 0x4000;
            processorTarget.addDeploymentProcessor(SwitchYardExtension.SUBSYSTEM_NAME, Phase.PARSE, priority++, new SwitchYardConfigDeploymentProcessor());
            processorTarget.addDeploymentProcessor(SwitchYardExtension.SUBSYSTEM_NAME, Phase.DEPENDENCIES, priority++, new SwitchYardDependencyProcessor());
            processorTarget.addDeploymentProcessor(SwitchYardExtension.SUBSYSTEM_NAME, Phase.POST_MODULE, priority++, new SwitchYardConfigProcessor());
            processorTarget.addDeploymentProcessor(SwitchYardExtension.SUBSYSTEM_NAME, Phase.INSTALL, priority++, new SwitchYardDeploymentProcessor());
        }
    }, OperationContext.Stage.RUNTIME);
    LOG.trace("Activating SwitchYard Subsystem");

    ServerUtil.setRegistry(context.getServiceRegistry(false));
    final SwitchYardInjectorService injectorService = new SwitchYardInjectorService();
    final ServiceBuilder<Map<String, String>> injectorServiceBuilder = context.getServiceTarget().addService(SwitchYardInjectorService.SERVICE_NAME, injectorService);
    if (model.hasDefined(SOCKET_BINDING)) {
        StringTokenizer sockets = new StringTokenizer(Attributes.SOCKET_BINDING.resolveModelAttribute(context,model).asString(), ",");
        while (sockets.hasMoreTokens()) {
            String socketName = sockets.nextToken();
            final ServiceName serviceName = context.getCapabilityServiceName(AbstractSocketBindingResourceDefinition.SOCKET_BINDING_CAPABILITY_NAME, socketName, SocketBinding.class);
            injectorServiceBuilder.addDependency(serviceName, SocketBinding.class, injectorService.getSocketBinding(socketName));
        }
    }
    injectorServiceBuilder.setInitialMode(Mode.ACTIVE);
    injectorServiceBuilder.install();

    // Add the AS7 Service for the SystemSecurity...
    final SwitchYardSystemSecurityService systemSecurityService = new SwitchYardSystemSecurityService();
    context.getServiceTarget()
           .addService(SwitchYardSystemSecurityService.SERVICE_NAME, systemSecurityService)
           .install();

    // Add the AS7 Service for the ServiceDomainManager...
    final SwitchYardServiceDomainManagerService serviceDomainManagerService = new SwitchYardServiceDomainManagerService();
    context.getServiceTarget()
           .addService(SwitchYardServiceDomainManagerService.SERVICE_NAME, serviceDomainManagerService)
           .addDependency(SwitchYardSystemSecurityService.SERVICE_NAME, SystemSecurity.class, serviceDomainManagerService.getSystemSecurity())
           // TODO find an alternative to using DependencyType.OPTIONAL
           .addDependency(DependencyType.OPTIONAL, CacheServiceName.CACHE.getServiceName("cluster"), Cache.class, serviceDomainManagerService.getCache())
           .install();

    final SwitchYardAdminService adminService = new SwitchYardAdminService();
    final ServiceBuilder<SwitchYard> adminServiceBuilder = context.getServiceTarget().addService(SwitchYardAdminService.SERVICE_NAME, adminService);
    adminServiceBuilder.setInitialMode(Mode.ACTIVE);
    adminServiceBuilder.addDependency(SwitchYardInjectorService.SERVICE_NAME, Map.class, adminService.getSocketBindings())
                       .addDependency(SwitchYardServiceDomainManagerService.SERVICE_NAME, ServiceDomainManager.class, adminService.getServiceDomainManager())
                       .install();

}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:52,代码来源:SwitchYardSubsystemAdd.java


注:本文中的org.jboss.msc.service.ServiceBuilder.setInitialMode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。