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


Java Services类代码示例

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


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


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