• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Services类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.jboss.as.server.Services的典型用法代码示例。如果您正苦于以下问题:Java Services类的具体用法?Java Services怎么用?Java Services使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Services类属于org.jboss.as.server包,在下文中一共展示了Services类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: activate

import org.jboss.as.server.Services; //导入依赖的package包/类
@Override
public void activate(ServiceActivatorContext serviceActivatorContext) throws ServiceRegistryException {

    ServiceTarget target = serviceActivatorContext.getServiceTarget();

    MetricsService service = new MetricsService();
    ServiceBuilder<MetricsService> metricsServiceBuilder = target.addService(MetricsService.SERVICE_NAME, service);

    RegistryFactory factory = new RegistryFactoryImpl();

    ServiceBuilder<MetricsService> serviceBuilder = metricsServiceBuilder
            .addDependency(ServerEnvironmentService.SERVICE_NAME, ServerEnvironment.class, service.getServerEnvironmentInjector())
            .addDependency(ServiceName.parse("jboss.eclipse.microprofile.config.config-provider"))
            .addDependency(Services.JBOSS_SERVER_CONTROLLER, ModelController.class, service.getModelControllerInjector());

    serviceBuilder.setInitialMode(ServiceController.Mode.ACTIVE)
            .install();

    BinderService binderService = new BinderService(SWARM_MP_METRICS, null, true);

    target.addService(ContextNames.buildServiceName(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, SWARM_MP_METRICS), binderService)
            .addDependency(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, ServiceBasedNamingStore.class, binderService.getNamingStoreInjector())
            .addInjection(binderService.getManagedObjectInjector(), new ImmediateManagedReferenceFactory(factory))
            .setInitialMode(ServiceController.Mode.ACTIVE)
            .install();
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:27,代码来源:MetricsServiceActivator.java


示例2: addService

import org.jboss.as.server.Services; //导入依赖的package包/类
public static ServiceController<?> addService(final OperationContext context, final String resolvedDomainName, final String expressionsDomainName, final boolean legacyWithProperPropertyFormat,
                                              final boolean coreMBeanSensitivity,
                                              final ManagedAuditLogger auditLoggerInfo,
                                              final JmxAuthorizer authorizer,
                                              final Supplier<SecurityIdentity> securityIdentitySupplier,
                                              final JmxEffect jmxEffect,
                                              final ProcessType processType, final boolean isMasterHc) {
    final MBeanServerService service = new MBeanServerService(resolvedDomainName, expressionsDomainName, legacyWithProperPropertyFormat,
            coreMBeanSensitivity, auditLoggerInfo, authorizer, securityIdentitySupplier, jmxEffect, processType, isMasterHc);
    final ServiceName modelControllerName = processType.isHostController() ?
            DOMAIN_CONTROLLER_NAME : Services.JBOSS_SERVER_CONTROLLER;
    return context.getServiceTarget().addService(MBeanServerService.SERVICE_NAME, service)
        .setInitialMode(ServiceController.Mode.ACTIVE)
        .addDependency(modelControllerName, ModelController.class, service.modelControllerValue)
        .addDependency(context.getCapabilityServiceName("org.wildfly.management.notification-handler-registry", null), NotificationHandlerRegistry.class, service.notificationRegistryValue)
        .addDependency(ManagementModelIntegration.SERVICE_NAME, ManagementModelIntegration.ManagementModelProvider.class, service.managementModelProviderValue)
        .addAliases(LEGACY_MBEAN_SERVER_NAME)
            .install();
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:20,代码来源:MBeanServerService.java


示例3: installRemotingServicesIfNotInstalled

import org.jboss.as.server.Services; //导入依赖的package包/类
static synchronized void installRemotingServicesIfNotInstalled(final ServiceTarget serviceTarget,
                                                               final String hostName,
                                                               final ServiceRegistry serviceContainer) {

    if (serviceContainer.getService(ManagementRemotingServices.MANAGEMENT_ENDPOINT) == null) {

        ManagementChannelRegistryService.addService(serviceTarget, ManagementRemotingServices.MANAGEMENT_ENDPOINT);

        ManagementRemotingServices.installRemotingManagementEndpoint(serviceTarget, ManagementRemotingServices.MANAGEMENT_ENDPOINT, hostName, EndpointService.EndpointType.MANAGEMENT, OPTIONS);


        ManagementRemotingServices.installManagementChannelServices(serviceTarget,
                ManagementRemotingServices.MANAGEMENT_ENDPOINT,
                new ModelControllerClientOperationHandlerFactoryService(),
                Services.JBOSS_SERVER_CONTROLLER,
                ManagementRemotingServices.MANAGEMENT_CHANNEL,
                ServerService.EXECUTOR_CAPABILITY.getCapabilityServiceName(),
                ServerService.JBOSS_SERVER_SCHEDULED_EXECUTOR);

    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:22,代码来源:NativeManagementServices.java


示例4: install

import org.jboss.as.server.Services; //导入依赖的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


示例5: createService

import org.jboss.as.server.Services; //导入依赖的package包/类
public static ServiceController<RhqMetricsService> createService(final ServiceTarget target,
                                                                 final ServiceVerificationHandler verificationHandler,
                                                                 ModelNode config) {

    RhqMetricsService service = new RhqMetricsService(config);

    return target.addService(SERVICE_NAME, service)
            .addDependency(ServerEnvironmentService.SERVICE_NAME, ServerEnvironment.class,
                    service.serverEnvironmentValue)
            .addDependency(Services.JBOSS_SERVER_CONTROLLER, ModelController.class,
                    service.modelControllerValue)
            .addDependency(ControlledProcessStateService.SERVICE_NAME, ControlledProcessStateService.class,
                    service.processStateValue)
            .addListener(verificationHandler)
            .setInitialMode(ServiceController.Mode.ACTIVE)
            .install();
}
 
开发者ID:hawkular,项目名称:wildfly-monitor,代码行数:18,代码来源:RhqMetricsService.java


示例6: activate

import org.jboss.as.server.Services; //导入依赖的package包/类
@Override
public void activate(ServiceActivatorContext context) throws ServiceRegistryException {
    Optional<String> securityRealm = Optional.empty();

    if (!healthFractionInstance.isUnsatisfied()) {
        securityRealm = healthFractionInstance.get().securityRealm();
    }

    ServiceTarget target = context.getServiceTarget();

    MonitorService service = new MonitorService(securityRealm);

    ServiceBuilder<MonitorService> monitorServiceServiceBuilder = target.addService(MonitorService.SERVICE_NAME, service);

    ServiceBuilder<MonitorService> serviceBuilder = monitorServiceServiceBuilder
            .addDependency(ServerEnvironmentService.SERVICE_NAME, ServerEnvironment.class, service.getServerEnvironmentInjector())
            .addDependency(Services.JBOSS_SERVER_CONTROLLER, ModelController.class, service.getModelControllerInjector());

    if (securityRealm.isPresent()) { // configured through the fraction interface
        serviceBuilder.addDependency(
                createRealmName(securityRealm.get()),
                SecurityRealm.class,
                service.getSecurityRealmInjector()
        );
    }

    serviceBuilder.setInitialMode(ServiceController.Mode.ACTIVE)
            .install();

    BinderService binderService = new BinderService(Monitor.JNDI_NAME, null, true);

    target.addService(ContextNames.buildServiceName(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, Monitor.JNDI_NAME), binderService)
            .addDependency(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, ServiceBasedNamingStore.class, binderService.getNamingStoreInjector())
            .addInjection(binderService.getManagedObjectInjector(), new ImmediateManagedReferenceFactory(service))
            .setInitialMode(ServiceController.Mode.ACTIVE)
            .install();

}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:39,代码来源:MonitorServiceActivator.java


示例7: activate

import org.jboss.as.server.Services; //导入依赖的package包/类
@Override
public void activate(ServiceActivatorContext context) throws ServiceRegistryException {
    Optional<String> securityRealm = Optional.empty();

    if (!monitorFractionInstance.isUnsatisfied()) {
        securityRealm = monitorFractionInstance.get().securityRealm();
    }

    ServiceTarget target = context.getServiceTarget();

    MonitorService service = new MonitorService(securityRealm);

    ServiceBuilder<MonitorService> monitorServiceServiceBuilder = target.addService(MonitorService.SERVICE_NAME, service);

    ServiceBuilder<MonitorService> serviceBuilder = monitorServiceServiceBuilder
            .addDependency(ServerEnvironmentService.SERVICE_NAME, ServerEnvironment.class, service.getServerEnvironmentInjector())
            .addDependency(Services.JBOSS_SERVER_CONTROLLER, ModelController.class, service.getModelControllerInjector());

    if (securityRealm.isPresent()) { // configured through the fraction interface
        serviceBuilder.addDependency(
                createRealmName(securityRealm.get()),
                SecurityRealm.class,
                service.getSecurityRealmInjector()
        );
    }

    serviceBuilder.setInitialMode(ServiceController.Mode.ACTIVE)
            .install();

    BinderService binderService = new BinderService(Monitor.JNDI_NAME, null, true);

    target.addService(ContextNames.buildServiceName(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, Monitor.JNDI_NAME), binderService)
            .addDependency(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, ServiceBasedNamingStore.class, binderService.getNamingStoreInjector())
            .addInjection(binderService.getManagedObjectInjector(), new ImmediateManagedReferenceFactory(service))
            .setInitialMode(ServiceController.Mode.ACTIVE)
            .install();

}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:39,代码来源:MonitorServiceActivator.java


示例8: activate

import org.jboss.as.server.Services; //导入依赖的package包/类
@Override
public void activate(ServiceActivatorContext context) throws ServiceRegistryException {
   final GetModelControllerService service = new GetModelControllerService();
   LOG.info(i18n.format("RTGovUIServiceActivator.Activating")); //$NON-NLS-1$
   context
       .getServiceTarget()
       .addService(ServiceName.of("management", "client", "getter"), service) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
       .addDependency(Services.JBOSS_SERVER_CONTROLLER, ModelController.class, service.modelControllerValue)
       .install();
}
 
开发者ID:Governance,项目名称:rtgov-ui,代码行数:11,代码来源:RTGovUIServiceActivator.java


示例9: setupController

import org.jboss.as.server.Services; //导入依赖的package包/类
@Before
public void setupController() throws InterruptedException {
    container = ServiceContainer.Factory.create("test");
    ServiceTarget target = container.subTarget();
    ModelControllerService svc = new ModelControllerService(processType, getAuditLogger(), getAuthorizer());
    ServiceBuilder<ModelController> builder = target.addService(Services.JBOSS_SERVER_CONTROLLER, svc);
    builder.install();
    svc.awaitStartup(30, TimeUnit.SECONDS);
    controller = svc.getValue();
    //ModelNode setup = Util.getEmptyOperation("setup", new ModelNode());
    //controller.execute(setup, null, null, null);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:13,代码来源:AbstractControllerTestBase.java


示例10: addService

import org.jboss.as.server.Services; //导入依赖的package包/类
public static void addService(final ServiceTarget serviceTarget, final ServiceName clientFactoryService, final ServiceName scheduledExecutorServiceName) {
    final ContentCleanerService service = new ContentCleanerService(true);
    ServiceBuilder<Void> builder = serviceTarget.addService(SERVICE_NAME, service)
            .addDependency(clientFactoryService, ModelControllerClientFactory.class, service.clientFactoryValue)
            .addDependency(ControlledProcessStateService.SERVICE_NAME, ControlledProcessStateService.class, service.controlledProcessStateServiceValue)
            .addDependency(scheduledExecutorServiceName, ScheduledExecutorService.class, service.scheduledExecutorValue);
    Services.addServerExecutorDependency(builder, service.executorServiceValue);
    builder.install();
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:10,代码来源:ContentCleanerService.java


示例11: performRuntime

import org.jboss.as.server.Services; //导入依赖的package包/类
@Override
public void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException {
    final ServiceTarget serviceTarget = context.getServiceTarget();
    final ServiceName endpointName = RemotingServices.SUBSYSTEM_ENDPOINT;
    ManagementChannelRegistryService.addService(serviceTarget, endpointName);
    ManagementRemotingServices.installManagementChannelServices(serviceTarget,
            endpointName,
            new ModelControllerClientOperationHandlerFactoryService(),
            Services.JBOSS_SERVER_CONTROLLER,
            ManagementRemotingServices.MANAGEMENT_CHANNEL,
            ServerService.EXECUTOR_CAPABILITY.getCapabilityServiceName(),
            ServerService.JBOSS_SERVER_SCHEDULED_EXECUTOR);
    List<ServiceName> requiredServices = Collections.singletonList(RemotingServices.channelServiceName(endpointName, ManagementRemotingServices.MANAGEMENT_CHANNEL));
    addVerifyInstallationStep(context, requiredServices);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:16,代码来源:NativeRemotingManagementAddHandler.java


示例12: install

import org.jboss.as.server.Services; //导入依赖的package包/类
static void install(ServiceTarget serviceTarget, ProcessType processType, RunningMode runningMode, String listenerName, ProcessStateListener listener, Map<String, String> properties, int timeout) {
    ProcessStateListenerService service = new ProcessStateListenerService(processType, runningMode, listenerName, listener, properties, timeout);
    ServiceBuilder<Void> builder = serviceTarget.addService(SERVICE_NAME.append(listenerName), service)
            .addDependency(ControlledProcessStateService.SERVICE_NAME, ControlledProcessStateService.class, service.controlledProcessStateService);
    if (!processType.isHostController()) {
        builder.addDependency(SuspendController.SERVICE_NAME, SuspendController.class, service.suspendControllerInjectedValue);
    }
    Services.addServerExecutorDependency(builder, service.executorServiceValue);
    builder.install();
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:11,代码来源:ProcessStateListenerService.java


示例13: addService

import org.jboss.as.server.Services; //导入依赖的package包/类
public static void addService(final ServiceTarget serviceTarget) {
    Service<ModuleIndexService> service = new ModuleIndexService();
    ServiceBuilder<?> serviceBuilder = serviceTarget.addService(Services.JBOSS_MODULE_INDEX_SERVICE, service);
    serviceBuilder.install();
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:6,代码来源:ModuleIndexService.java


示例14: addService

import org.jboss.as.server.Services; //导入依赖的package包/类
public static void addService(final ServiceTarget serviceTarget) {
    Service<ExternalModuleService> service = new ExternalModuleService();
    ServiceBuilder<?> serviceBuilder = serviceTarget.addService(Services.JBOSS_EXTERNAL_MODULE_SERVICE, service);
    serviceBuilder.install();
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:6,代码来源:ExternalModuleService.java


示例15: addService

import org.jboss.as.server.Services; //导入依赖的package包/类
public static void addService(final ServiceTarget serviceTarget, final Bootstrap.Configuration configuration) {
    final Service<ServiceModuleLoader> service = new ServiceModuleLoader(configuration.getModuleLoader());
    final ServiceBuilder<?> serviceBuilder = serviceTarget.addService(Services.JBOSS_SERVICE_MODULE_LOADER, service);
    serviceBuilder.install();
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:6,代码来源:ServiceModuleLoader.java


示例16: create

import org.jboss.as.server.Services; //导入依赖的package包/类
public static AbstractKernelServicesImpl create(ProcessType processType, RunningModeControl runningModeControl, ModelTestOperationValidatorFilter validateOpsFilter,
        List<ModelNode> bootOperations, ModelTestParser testParser, ModelVersion legacyModelVersion, TestModelType type, ModelInitializer modelInitializer, ExtensionRegistry extensionRegistry, List<String> contentRepositoryHashes) throws Exception {

    //TODO initialize the path manager service like we do for subsystems?

    //Create the controller
    ServiceContainer container = ServiceContainer.Factory.create("core-test" + counter.incrementAndGet());
    ServiceTarget target = container.subTarget();

    //Initialize the content repository
    File repositoryFile = new File("target/deployment-repository");
    if (contentRepositoryHashes != null) {
        deleteFile(repositoryFile);
        repositoryFile.mkdir();
        for (String hash : contentRepositoryHashes) {
            File file = new File(repositoryFile, hash.substring(0, 2));
            file.mkdir();
            file = new File(file, hash.substring(2, hash.length()));
            file.mkdir();
            file = new File(file, "content");
            file.createNewFile();
        }
    }
    ContentRepository.Factory.addService(target, repositoryFile);

    //Initialize the controller
    StringConfigurationPersister persister = new StringConfigurationPersister(bootOperations, testParser, true);

    //Use the default implementation of test controller for the main controller, and for tests that don't have another one set up on the classpath
    TestModelControllerFactory testModelControllerFactory = StandardTestModelControllerServiceFactory.INSTANCE;
    if (legacyModelVersion != null) {
        ServiceLoader<TestModelControllerFactory> factoryLoader = ServiceLoader.load(TestModelControllerFactory.class, AbstractKernelServicesImpl.class.getClassLoader());
        for (TestModelControllerFactory factory : factoryLoader) {
            testModelControllerFactory = factory;
            break;
        }
    }

    ModelTestModelControllerService svc = testModelControllerFactory.create(processType, runningModeControl, persister, validateOpsFilter, type, modelInitializer, extensionRegistry);

    ServiceBuilder<ModelController> builder = target.addService(Services.JBOSS_SERVER_CONTROLLER, svc);
    builder.addDependency(ContentRepository.SERVICE_NAME, ContentRepository.class, testModelControllerFactory.getContentRepositoryInjector(svc));
    builder.install();
    if (legacyModelVersion == null) {
        ExecutorService mgmtExecutor = new EnhancedQueueExecutor.Builder()
            .setCorePoolSize(1)
            .setMaximumPoolSize(256)
            .setKeepAliveTime(20L, TimeUnit.SECONDS)
            .build();
        Service<ExecutorService> mgmtExecSvc = new ValueService<>(new ImmediateValue<>(mgmtExecutor));
        target.addService(AbstractControllerService.EXECUTOR_CAPABILITY.getCapabilityServiceName(), mgmtExecSvc).install();
    }

    //sharedState = svc.state;
    svc.waitForSetup();
    //processState.setRunning();

    AbstractKernelServicesImpl kernelServices = legacyModelVersion == null ?
            new MainKernelServicesImpl(container, svc, persister, svc.getRootRegistration(),
                    new OperationValidator(svc.getRootRegistration()), legacyModelVersion, svc.isSuccessfulBoot(), svc.getBootError(), extensionRegistry) :
                        new LegacyKernelServicesImpl(container, svc, persister, svc.getRootRegistration(),
                                new OperationValidator(svc.getRootRegistration()), legacyModelVersion, svc.isSuccessfulBoot(), svc.getBootError(), extensionRegistry, ContentRepository.Factory.create(repositoryFile));

    return kernelServices;
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:66,代码来源:AbstractKernelServicesImpl.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TripleSource类代码示例发布时间:2022-05-22
下一篇:
Java HasPropertyWithValue类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap