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

Java Mode类代码示例

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

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



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

示例1: performRuntime

import org.jboss.msc.service.ServiceController.Mode; //导入依赖的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.ServiceController.Mode; //导入依赖的package包/类
@Override
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model)
        throws OperationFailedException {
    RuntimeCapability<Void> runtimeCapability = SASL_SERVER_FACTORY_RUNTIME_CAPABILITY.fromBaseCapability(context.getCurrentAddressValue());
    ServiceName saslServerFactoryName = runtimeCapability.getCapabilityServiceName(SaslServerFactory.class);

    commonDependencies(installService(context, saslServerFactoryName, model))
        .setInitialMode(Mode.ACTIVE)
        .install();
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:11,代码来源:SaslServerDefinitions.java


示例3: addDataSourceListener

import org.jboss.msc.service.ServiceController.Mode; //导入依赖的package包/类
static void addDataSourceListener(
		final ServiceTarget serviceTarget,
		final VDBKey vdbKey,
		final String dsName) {
	final String jndiName = getJndiName(dsName);
	ServiceName dsListenerServiceName;
	try {
		dsListenerServiceName = TeiidServiceNames.dsListenerServiceName(vdbKey.getName(), vdbKey.getVersion(), dsName);
	} catch (InvalidServiceNameException e) {
		LogManager.logWarning(LogConstants.CTX_RUNTIME, e, e.getMessage());
		return;
	}
	ContextNames.BindInfo bindInfo = ContextNames.bindInfoFor(jndiName);
	final ServiceName svcName = bindInfo.getBinderServiceName();
	DataSourceListener dsl = new DataSourceListener(dsName, svcName, vdbKey);									
	ServiceBuilder<DataSourceListener> sb = serviceTarget.addService(dsListenerServiceName, dsl);
	sb.addDependency(svcName);
	sb.addDependency(TeiidServiceNames.VDB_STATUS_CHECKER, VDBStatusChecker.class, dsl.vdbStatusCheckInjector);
	sb.setInitialMode(Mode.PASSIVE).install();
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:21,代码来源:VDBDeployer.java


示例4: undeploy

import org.jboss.msc.service.ServiceController.Mode; //导入依赖的package包/类
@Override
public void undeploy(final DeploymentUnit context) {
	if (!TeiidAttachments.isTranslator(context)) {
    	return;
    }
	VDBTranslatorMetaData metadata = context.getAttachment(TeiidAttachments.TRANSLATOR_METADATA);
	if (metadata == null) {
		return;
	}
	final ServiceRegistry registry = context.getServiceRegistry();
    final ServiceName serviceName = TeiidServiceNames.translatorServiceName(metadata.getName());
    final ServiceController<?> controller = registry.getService(serviceName);
    if (controller != null) {
    	controller.setMode(Mode.REMOVE);
    }
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:17,代码来源:TranslatorDeployer.java


示例5: performRuntime

import org.jboss.msc.service.ServiceController.Mode; //导入依赖的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


示例6: performRuntime

import org.jboss.msc.service.ServiceController.Mode; //导入依赖的package包/类
@Override
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model)
        throws OperationFailedException {
    ServiceTarget serviceTarget = context.getServiceTarget();

    String address = context.getCurrentAddressValue();
    RuntimeCapability<?> primaryCapability = runtimeCapabilities[0];
    ServiceName primaryServiceName = toServiceName(primaryCapability, address);

    final String module = MODULE.resolveModelAttribute(context, model).asStringOrNull();
    final String className = CLASS_NAME.resolveModelAttribute(context, model).asString();

    final Map<String, String> configurationMap;
    configurationMap = CONFIGURATION.unwrap(context, model);

    TrivialService<T> customComponentService = new TrivialService<T>(() -> createValue(module, className, configurationMap));

    ServiceBuilder<T> serviceBuilder = serviceTarget.addService(primaryServiceName, customComponentService);
    for (int i=1;i<runtimeCapabilities.length;i++) {
        serviceBuilder.addAliases(toServiceName(runtimeCapabilities[i], address));
    }

    commonDependencies(serviceBuilder)
        .setInitialMode(Mode.ACTIVE)
        .install();
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:27,代码来源:CustomComponentDefinition.java


示例7: performRuntime

import org.jboss.msc.service.ServiceController.Mode; //导入依赖的package包/类
@Override
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model)
        throws OperationFailedException {
    ServiceTarget serviceTarget = context.getServiceTarget();
    RuntimeCapability<Void> runtimeCapability = SECURITY_REALM_RUNTIME_CAPABILITY.fromBaseCapability(context.getCurrentAddressValue());
    ServiceName realmName = runtimeCapability.getCapabilityServiceName(SecurityRealm.class);

    final InjectedValue<KeyStore> keyStore = new InjectedValue<KeyStore>();
    TrivialService<SecurityRealm> keyStoreRealmService = new TrivialService<SecurityRealm>(() -> new KeyStoreBackedSecurityRealm(keyStore.getValue()));

    ServiceBuilder<SecurityRealm> serviceBuilder = serviceTarget.addService(realmName, keyStoreRealmService);

    String keyStoreCapabilityName = RuntimeCapability.buildDynamicCapabilityName(KEY_STORE_CAPABILITY, KEYSTORE.resolveModelAttribute(context, model).asString());
    ServiceName keyStoreServiceName = context.getCapabilityServiceName(keyStoreCapabilityName, KeyStore.class);
    KEY_STORE_UTIL.addInjection(serviceBuilder, keyStore, keyStoreServiceName);
    commonDependencies(serviceBuilder)
        .setInitialMode(Mode.ACTIVE)
        .install();
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:20,代码来源:KeyStoreRealmDefinition.java


示例8: performRuntime

import org.jboss.msc.service.ServiceController.Mode; //导入依赖的package包/类
@Override
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model)
        throws OperationFailedException {
    ServiceTarget serviceTarget = context.getServiceTarget();
    RuntimeCapability<?> instanceRuntimeCapability = runtimeCapability.fromBaseCapability(context.getCurrentAddressValue());
    ServiceName componentName = instanceRuntimeCapability.getCapabilityServiceName(aggregationType);

    AggregateComponentService<T> aggregateComponentService = new AggregateComponentService<T>(aggregationType, aggregator);

    ServiceBuilder<T> serviceBuilder = serviceTarget.addService(componentName, aggregateComponentService);

    List<String> aggregates = aggregateReferences.unwrap(context, model);

    String baseCapabilityName = runtimeCapability.getName();
    for (String current : aggregates) {
        String runtimeCapabilityName = RuntimeCapability.buildDynamicCapabilityName(baseCapabilityName, current);
        ServiceName realmServiceName = context.getCapabilityServiceName(runtimeCapabilityName, aggregationType);

        serviceBuilder.addDependency(realmServiceName, aggregationType, aggregateComponentService.newInjector());
    }

    commonDependencies(serviceBuilder, true, dependOnProviderRegistration)
        .setInitialMode(Mode.LAZY)
        .install();
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:26,代码来源:AggregateComponentDefinition.java


示例9: performRuntime

import org.jboss.msc.service.ServiceController.Mode; //导入依赖的package包/类
@Override
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model)
        throws OperationFailedException {
    ServiceTarget serviceTarget = context.getServiceTarget();
    RuntimeCapability<Void> runtimeCapability = ROLE_DECODER_RUNTIME_CAPABILITY.fromBaseCapability(context.getCurrentAddressValue());
    ServiceName roleDecoderName = runtimeCapability.getCapabilityServiceName(RoleDecoder.class);

    final String attribute = ATTRIBUTE.resolveModelAttribute(context, model).asString();
    TrivialService<RoleDecoder> roleDecoderService = new TrivialService<RoleDecoder>(() -> RoleDecoder.simple(attribute));

    ServiceBuilder<RoleDecoder> roleDecoderBuilderBuilder = serviceTarget.addService(roleDecoderName, roleDecoderService);

    commonDependencies(roleDecoderBuilderBuilder)
        .setInitialMode(Mode.LAZY)
        .install();
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:17,代码来源:RoleDecoderDefinitions.java


示例10: performRuntime

import org.jboss.msc.service.ServiceController.Mode; //导入依赖的package包/类
@Override
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model)
        throws OperationFailedException {
    ServiceTarget serviceTarget = context.getServiceTarget();
    RuntimeCapability<Void> runtimeCapability = SECURITY_REALM_RUNTIME_CAPABILITY.fromBaseCapability(context.getCurrentAddressValue());
    ServiceName realmName = runtimeCapability.getCapabilityServiceName(SecurityRealm.class);

    String authenticationRealm = AUTHENTICATION_REALM.resolveModelAttribute(context, model).asString();
    String authorizationRealm = AUTHORIZATION_REALM.resolveModelAttribute(context, model).asString();

    final InjectedValue<SecurityRealm> authenticationRealmValue = new InjectedValue<SecurityRealm>();
    final InjectedValue<SecurityRealm> authorizationRealmValue = new InjectedValue<SecurityRealm>();

    TrivialService<SecurityRealm> aggregateRealmService = new TrivialService<SecurityRealm>( () -> new AggregateSecurityRealm(authenticationRealmValue.getValue(), authorizationRealmValue.getValue()));

    ServiceBuilder<SecurityRealm> serviceBuilder = serviceTarget.addService(realmName, aggregateRealmService);

    addRealmDependency(context, serviceBuilder, authenticationRealm, authenticationRealmValue);
    addRealmDependency(context, serviceBuilder, authorizationRealm, authorizationRealmValue);

    commonDependencies(serviceBuilder)
        .setInitialMode(Mode.ACTIVE)
        .install();
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:25,代码来源:AggregateRealmDefinition.java


示例11: performRuntime

import org.jboss.msc.service.ServiceController.Mode; //导入依赖的package包/类
@Override
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model)
        throws OperationFailedException {

ServiceTarget serviceTarget = context.getServiceTarget();
RuntimeCapability<?> runtimeCapability = this.runtimeCapability.fromBaseCapability(context.getCurrentAddressValue());
ServiceName componentName = runtimeCapability.getCapabilityServiceName(valueType);

TrivialService<T> componentService = new TrivialService<T>(valueSupplier);

ServiceBuilder<T> componentBuilder = serviceTarget.addService(componentName, componentService);

commonDependencies(componentBuilder)
    .setInitialMode(Mode.LAZY)
    .install();
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:17,代码来源:EmptyResourceDefinition.java


示例12: addPlugInLoaderService

import org.jboss.msc.service.ServiceController.Mode; //导入依赖的package包/类
private ServiceName addPlugInLoaderService(String realmName, ModelNode plugInModel,
                                           ServiceTarget serviceTarget) {
    ServiceName plugInLoaderName = PlugInLoaderService.ServiceUtil.createServiceName(realmName);

    List<Property> plugIns = plugInModel.asPropertyList();
    ArrayList<String> knownNames = new ArrayList<String>(plugIns.size());
    for (Property current : plugIns) {
        knownNames.add(current.getName());
    }
    PlugInLoaderService loaderService = new PlugInLoaderService(Collections.unmodifiableList(knownNames));
    serviceTarget.addService(plugInLoaderName, loaderService)
            .setInitialMode(Mode.ON_DEMAND)
            .install();

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


示例13: performRuntime

import org.jboss.msc.service.ServiceController.Mode; //导入依赖的package包/类
@Override
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException {
    String securityDomain = SECURITY_DOMAIN.resolveModelAttribute(context, model).asString();
    final InjectedValue<SecurityDomain> securityDomainInjected = new InjectedValue<>();

    final IdentityService service = new IdentityService(securityIdentitySupplier);

    ServiceBuilder<Void> serviceBuilder = context.getServiceTarget().addService(MANAGEMENT_IDENTITY_RUNTIME_CAPABILITY.getCapabilityServiceName(), service)
            .setInitialMode(Mode.ACTIVE);

    serviceBuilder.addDependency(context.getCapabilityServiceName(RuntimeCapability.buildDynamicCapabilityName(SECURITY_DOMAIN_CAPABILITY, securityDomain), SecurityDomain.class), SecurityDomain.class, securityDomainInjected);

    service.setConfiguredSecurityDomain(securityDomainInjected);
    serviceBuilder.install();
    //Let's verify that the IdentityService is correctly started.
    context.addStep((OperationContext context1, ModelNode operation1) -> {
        try {
            ServiceController<?> controller = context1.getServiceRegistry(false).getRequiredService(MANAGEMENT_IDENTITY_RUNTIME_CAPABILITY.getCapabilityServiceName());
            if (controller == null || State.UP != controller.getState()) {
                context.setRollbackOnly();
            }
        } catch (ServiceNotFoundException ex) {
            context.setRollbackOnly();
        }
    }, OperationContext.Stage.VERIFY);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:27,代码来源:AccessIdentityResourceDefinition.java


示例14: installRemotingManagementEndpoint

import org.jboss.msc.service.ServiceController.Mode; //导入依赖的package包/类
public static void installRemotingManagementEndpoint(final ServiceTarget serviceTarget, final ServiceName endpointName,
                                                     final String hostName, final EndpointService.EndpointType type, final OptionMap options) {
    EndpointService service = new EndpointService(hostName, type, options);
    serviceTarget.addService(endpointName, service)
            .setInitialMode(Mode.ACTIVE)
            .addDependency(ServiceName.JBOSS.append("serverManagement", "controller", "management", "worker"), XnioWorker.class, service.getWorker())
            .install();
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:9,代码来源:RemotingServices.java


示例15: installAliases

import org.jboss.msc.service.ServiceController.Mode; //导入依赖的package包/类
private void installAliases(final ModuleSpecification moduleSpecification, final ModuleIdentifier moduleIdentifier, final DeploymentUnit deploymentUnit, final DeploymentPhaseContext phaseContext) {

        for (final ModuleIdentifier alias : moduleSpecification.getAliases()) {
            final ServiceName moduleSpecServiceName = ServiceModuleLoader.moduleSpecServiceName(alias);
            final ModuleSpec spec = ModuleSpec.buildAlias(alias, moduleIdentifier).create();

            ModuleDefinition moduleDefinition = new ModuleDefinition(alias, new HashSet<>(moduleSpecification.getAllDependencies()), spec);

            final ValueService<ModuleDefinition> moduleSpecService = new ValueService<>(new ImmediateValue<>(moduleDefinition));
            phaseContext.getServiceTarget().addService(moduleSpecServiceName, moduleSpecService).addDependencies(
                    deploymentUnit.getServiceName()).addDependencies(phaseContext.getPhaseServiceName()).setInitialMode(
                    Mode.ON_DEMAND).install();
            ModuleLoadService.installService(phaseContext.getServiceTarget(), alias, Collections.singletonList(moduleIdentifier));

            ModuleResolvePhaseService.installService(phaseContext.getServiceTarget(), moduleDefinition);
        }
    }
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:18,代码来源:ModuleSpecProcessor.java


示例16: installBindingService

import org.jboss.msc.service.ServiceController.Mode; //导入依赖的package包/类
static void installBindingService(OperationContext context, ModelNode config, String name)
        throws UnknownHostException, OperationFailedException {
    final CapabilityServiceTarget serviceTarget = context.getCapabilityServiceTarget();

    final ModelNode intfNode = AbstractSocketBindingResourceDefinition.INTERFACE.resolveModelAttribute(context, config);
    final String intf = intfNode.isDefined() ? intfNode.asString() : null;
    final int port = AbstractSocketBindingResourceDefinition.PORT.resolveModelAttribute(context, config).asInt();
    final boolean fixedPort = AbstractSocketBindingResourceDefinition.FIXED_PORT.resolveModelAttribute(context, config).asBoolean();
    final ModelNode mcastNode = AbstractSocketBindingResourceDefinition.MULTICAST_ADDRESS.resolveModelAttribute(context, config);
    final String mcastAddr = mcastNode.isDefined() ? mcastNode.asString() : null;
    final int mcastPort = AbstractSocketBindingResourceDefinition.MULTICAST_PORT.resolveModelAttribute(context, config).asInt(0);
    final InetAddress mcastInet = mcastAddr == null ? null : InetAddress.getByName(mcastAddr);
    final ModelNode mappingsNode = config.get(CLIENT_MAPPINGS);
    final List<ClientMapping> clientMappings = mappingsNode.isDefined() ? parseClientMappings(context, mappingsNode) : null;

    final SocketBindingService service = new SocketBindingService(name, port, fixedPort, mcastInet, mcastPort, clientMappings);
    final CapabilityServiceBuilder<SocketBinding> builder = serviceTarget.addCapability(SOCKET_BINDING_CAPABILITY, service);
    if (intf != null) {
        builder.addCapabilityRequirement("org.wildfly.network.interface", NetworkInterfaceBinding.class, service.getInterfaceBinding(), intf);
    }
    builder.addCapabilityRequirement("org.wildfly.management.socket-binding-manager", SocketBindingManager.class, service.getSocketBindings())
            .addAliases(SocketBinding.JBOSS_BINDING_NAME.append(name))
            .setInitialMode(Mode.ON_DEMAND)
            .install();
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:26,代码来源:BindingAddHandler.java


示例17: install

import org.jboss.msc.service.ServiceController.Mode; //导入依赖的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


示例18: addService

import org.jboss.msc.service.ServiceController.Mode; //导入依赖的package包/类
/**
 * Add the deployment scanner service to a batch.
 *
 * @param context           context for the operation that is adding this service
 * @param resourceAddress   the address of the resource that manages the service
 * @param relativeTo        the relative to
 * @param path              the path
 * @param scanInterval      the scan interval
 * @param unit              the unit of {@code scanInterval}
 * @param autoDeployZip     whether zipped content should be auto-deployed
 * @param autoDeployExploded whether exploded content should be auto-deployed
 * @param autoDeployXml     whether xml content should be auto-deployed
 * @param scanEnabled       scan enabled
 * @param deploymentTimeout the deployment timeout
 * @param rollbackOnRuntimeFailure rollback on runtime failures
 * @param bootTimeService   the deployment scanner used in the boot time scan
 * @param scheduledExecutorService executor to use for asynchronous tasks
 * @return the controller for the deployment scanner service
 */
public static ServiceController<DeploymentScanner> addService(final OperationContext context, final PathAddress resourceAddress, final String relativeTo, final String path,
                                                              final int scanInterval, TimeUnit unit, final boolean autoDeployZip,
                                                              final boolean autoDeployExploded, final boolean autoDeployXml, final boolean scanEnabled, final long deploymentTimeout, boolean rollbackOnRuntimeFailure,
                                                              final FileSystemDeploymentService bootTimeService, final ScheduledExecutorService scheduledExecutorService) {
    final DeploymentScannerService service = new DeploymentScannerService(resourceAddress, relativeTo, path, scanInterval, unit, autoDeployZip,
            autoDeployExploded, autoDeployXml, scanEnabled, deploymentTimeout, rollbackOnRuntimeFailure, bootTimeService);
    final ServiceName serviceName = getServiceName(resourceAddress.getLastElement().getValue());

    return context.getServiceTarget().addService(serviceName, service)
            .addDependency(context.getCapabilityServiceName(PATH_MANAGER_CAPABILITY, PathManager.class), PathManager.class, service.pathManagerValue)
            .addDependency(context.getCapabilityServiceName("org.wildfly.management.notification-handler-registry", null),
                    NotificationHandlerRegistry.class, service.notificationRegistryValue)
            .addDependency(context.getCapabilityServiceName("org.wildfly.management.model-controller-client-factory", null),
                    ModelControllerClientFactory.class, service.clientFactoryValue)
            .addDependency(org.jboss.as.server.deployment.Services.JBOSS_DEPLOYMENT_CHAINS)
            .addDependency(ControlledProcessStateService.SERVICE_NAME, ControlledProcessStateService.class, service.controlledProcessStateServiceValue)
            .addInjection(service.scheduledExecutorValue, scheduledExecutorService)
            .setInitialMode(Mode.ACTIVE)
            .install();
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:40,代码来源:DeploymentScannerService.java


示例19: performRuntime

import org.jboss.msc.service.ServiceController.Mode; //导入依赖的package包/类
@Override
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model,
        ServiceVerificationHandler verificationHandler, List<ServiceController<?>> newControllers)
        throws OperationFailedException {
  
  if (!operation.hasDefined(THREAD_POOL_NAME)) {
    throw new ProcessEngineException("Unable to configure threadpool for ContainerJobExecutorService, missing element '" + THREAD_POOL_NAME + "' in JobExecutor configuration.");
  }
  
  String jobExecutorThreadPoolName = operation.get(THREAD_POOL_NAME).asString();

  MscExecutorService service = new MscExecutorService();
  ServiceController<MscExecutorService> serviceController = context.getServiceTarget().addService(ServiceNames.forMscExecutorService(), service)
      .addDependency(ThreadsServices.EXECUTOR.append(jobExecutorThreadPoolName), ManagedQueueExecutorService.class, service.getManagedQueueInjector())
      .addListener(verificationHandler)
      .setInitialMode(Mode.ACTIVE)
      .install();
  
  newControllers.add(serviceController);
  
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:22,代码来源:JobExecutorAdd.java


示例20: initializeServiceBuilder

import org.jboss.msc.service.ServiceController.Mode; //导入依赖的package包/类
public static void initializeServiceBuilder(ManagedProcessEngineMetadata processEngineConfiguration, MscManagedProcessEngineController service,
        ServiceBuilder<ProcessEngine> serviceBuilder, String jobExecutorName) {

  ContextNames.BindInfo datasourceBindInfo = ContextNames.bindInfoFor(processEngineConfiguration.getDatasourceJndiName());
  serviceBuilder.addDependency(ServiceName.JBOSS.append("txn").append("TransactionManager"), TransactionManager.class, service.getTransactionManagerInjector())
    .addDependency(datasourceBindInfo.getBinderServiceName(), DataSourceReferenceFactoryService.class, service.getDatasourceBinderServiceInjector())
    .addDependency(ServiceNames.forMscRuntimeContainerDelegate(), MscRuntimeContainerDelegate.class, service.getRuntimeContainerDelegateInjector())
    .addDependency(ServiceNames.forMscRuntimeContainerJobExecutorService(jobExecutorName), MscRuntimeContainerJobExecutor.class, service.getMscRuntimeContainerJobExecutorInjector())
    .addDependency(ServiceNames.forMscExecutorService())
    .setInitialMode(Mode.ACTIVE);

  if(processEngineConfiguration.isDefault()) {
    serviceBuilder.addAliases(ServiceNames.forDefaultProcessEngine());
  }

  JBossCompatibilityExtension.addServerExecutorDependency(serviceBuilder, service.getExecutorInjector(), false);

}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:19,代码来源:MscManagedProcessEngineController.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java MDButton类代码示例发布时间:2022-05-22
下一篇:
Java SearchScript类代码示例发布时间: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