@Override public Lifecycle apply(ServiceTarget target) { ServiceBuilder<?> builder = target.addService(this.name); for (Map.Entry<ServiceName[], DeferredInjector<?>> entry : this.injectors) { entry.getValue().setConsumer(builder.provides(entry.getKey())); } return new ServiceLifecycle(builder.setInstance(this.service).setInitialMode(ServiceController.Mode.NEVER).install()); } }
/** * {@inheritDoc} */ @Override protected void performRuntime(final OperationContext context, final ModelNode operation, final ModelNode model) throws OperationFailedException { PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR)); final String jndiName = address.getLastElement().getValue(); final String tableName = CMResourceResourceDefinition.CM_TABLE_NAME.resolveModelAttribute(context, model).asString(); final int batchSize = CMResourceResourceDefinition.CM_TABLE_BATCH_SIZE.resolveModelAttribute(context, model).asInt(); final boolean immediateCleanup = CMResourceResourceDefinition.CM_TABLE_IMMEDIATE_CLEANUP.resolveModelAttribute(context, model).asBoolean(); ROOT_LOGGER.debugf("adding commit-markable-resource: jndi-name=%s, table-name=%s, batch-size=%d, immediate-cleanup=%b", jndiName, tableName, batchSize, immediateCleanup); CMResourceService service = new CMResourceService(jndiName, tableName, immediateCleanup, batchSize); context.getServiceTarget().addService(TxnServices.JBOSS_TXN_CMR.append(jndiName), service) .addDependency(TxnServices.JBOSS_TXN_JTA_ENVIRONMENT, JTAEnvironmentBean.class, service.getJTAEnvironmentBeanInjector()) .setInitialMode(ServiceController.Mode.ACTIVE) .install(); if (!context.isBooting()) { context.reloadRequired(); } } }
protected void performRuntime(final OperationContext context, ModelNode operation, final ModelNode model) throws OperationFailedException { final ModelNode pathNode = FileDataStoreResourceDefinition.PATH.resolveModelAttribute(context, model); final String path = pathNode.isDefined() ? pathNode.asString() : null; final ModelNode relativeToNode = FileDataStoreResourceDefinition.RELATIVE_TO.resolveModelAttribute(context, model); final String relativeTo = relativeToNode.isDefined() ? relativeToNode.asString() : null; final FileTimerPersistence fileTimerPersistence = new FileTimerPersistence(true, path, relativeTo); final PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR)); final ServiceName serviceName = TimerPersistence.SERVICE_NAME.append(address.getLastElement().getValue()); final ServiceBuilder sb = context.getServiceTarget().addService(serviceName, fileTimerPersistence); sb.addDependency(Services.JBOSS_SERVICE_MODULE_LOADER, ModuleLoader.class, fileTimerPersistence.getModuleLoader()); sb.addDependency(PathManagerService.SERVICE_NAME, PathManager.class, fileTimerPersistence.getPathManager()); sb.requires(context.getCapabilityServiceName("org.wildfly.transactions.global-default-local-provider", null)); sb.addDependency(context.getCapabilityServiceName("org.wildfly.transactions.transaction-synchronization-registry", null), TransactionSynchronizationRegistry.class, fileTimerPersistence.getTransactionSynchronizationRegistry()); sb.install(); }
public static ServiceController<UserTransaction> addService(final ServiceTarget target) { ServiceBuilder<UserTransaction> serviceBuilder = target.addService(INTERNAL_SERVICE_NAME, INSTANCE); serviceBuilder.requires(TxnServices.JBOSS_TXN_LOCAL_TRANSACTION_CONTEXT); return serviceBuilder.install(); }
public static ServiceController<JdrReportCollector> addService(final ServiceTarget target) { JdrReportService service = new JdrReportService(); return target.addService(SERVICE_NAME, service) .addDependency(ServerEnvironmentService.SERVICE_NAME, ServerEnvironment.class, service.serverEnvironmentValue) .addDependency(Services.JBOSS_SERVER_CONTROLLER, ModelController.class, service.modelControllerValue) .setInitialMode(ServiceController.Mode.ACTIVE) .install(); }
void install() { assertState(); createDestroyServiceBuilder.install(); startStopServiceBuilder.install(); // Add service to register the mbean in the mbean server final ServiceBuilder<?> sb = target.addService(MBeanRegistrationService.SERVICE_NAME.append(mBeanName)); final Supplier<MBeanServer> mBeanServerSupplier = sb.requires(mbeanServerServiceName); final Supplier<Object> objectSupplier = sb.requires(startStopServiceName); sb.setInstance(new MBeanRegistrationService(mBeanName, setupActions, mBeanServerSupplier, objectSupplier)); sb.install(); installed = true; }
@SuppressWarnings("deprecation") @Override public ServiceBuilder<?> build(ServiceTarget target) { if (!this.enabled) { // If naming is not enabled, just install a dummy service that never starts return target.addService(this.getServiceName()).setInitialMode(ServiceController.Mode.NEVER); } String name = this.binding.getBindName(); BinderService binder = new BinderService(name); // Until ServiceBasedNamingStore works with new MSC API, we need to use deprecated ServiceBuilder methods ServiceBuilder<ManagedReferenceFactory> builder = target.addService(this.getServiceName(), binder) .addAliases(ContextNames.JAVA_CONTEXT_SERVICE_NAME.append(name)) .addDependency(this.targetServiceName, Object.class, new ManagedReferenceInjector<>(binder.getManagedObjectInjector())) .addDependency(this.binding.getParentContextServiceName(), ServiceBasedNamingStore.class, binder.getNamingStoreInjector()) ; for (ContextNames.BindInfo alias : this.aliases) { builder.addAliases(alias.getBinderServiceName(), ContextNames.JAVA_CONTEXT_SERVICE_NAME.append(alias.getBindName())); } return builder.setInitialMode(ServiceController.Mode.PASSIVE); } }
final ServiceName driverDemanderServiceName = ServiceName.JBOSS.append("driver-demander").append(jndiName); final ServiceBuilder<?> driverDemanderBuilder = serviceTarget .addService(driverDemanderServiceName, driverDemanderService) .addDependency(driverServiceName, Driver.class, driverDemanderService.getInjector()); driverDemanderBuilder.setInitialMode(ServiceController.Mode.ACTIVE); Services.addServerExecutorDependency( serviceTarget.addService(dataSourceServiceName, dataSourceService), dataSourceService.getExecutorServiceInjector()) .addAliases(dataSourceServiceNameAlias) .addDependency(ConnectorServices.MANAGEMENT_REPOSITORY_SERVICE, ManagementRepository.class, dataSourceService.getManagementRepositoryInjector()) .addDependency(ConnectorServices.JDBC_DRIVER_REGISTRY_SERVICE, DriverRegistry.class, dataSourceService.getDriverRegistryInjector()); dataSourceServiceBuilder.requires(ConnectorServices.IDLE_REMOVER_SERVICE); dataSourceServiceBuilder.requires(ConnectorServices.CONNECTION_VALIDATOR_SERVICE); dataSourceServiceBuilder.addDependency(ConnectorServices.IRONJACAMAR_MDR, MetadataRepository.class, dataSourceService.getMdrInjector()); dataSourceServiceBuilder.requires(NamingService.SERVICE_NAME); if (jta) { dataSourceServiceBuilder.addDependency(ConnectorServices.TRANSACTION_INTEGRATION_SERVICE, TransactionIntegration.class, dataSourceService.getTransactionIntegrationInjector()); dataSourceServiceBuilder.addDependency(ConnectorServices.CCM_SERVICE, CachedConnectionManager.class, dataSourceService.getCcmInjector()); dataSourceServiceBuilder.requires(ConnectorServices.BOOTSTRAP_CONTEXT_SERVICE.append(DEFAULT_NAME)); dataSourceServiceBuilder.addDependency(ConnectorServices.RA_REPOSITORY_SERVICE, ResourceAdapterRepository.class, dataSourceService.getRaRepositoryInjector()); dataSourceServiceBuilder.addDependency(ConnectorServices.NON_JTA_DS_RA_REPOSITORY_SERVICE, ResourceAdapterRepository.class, dataSourceService.getRaRepositoryInjector()) .addDependency(ConnectorServices.NON_TX_CCM_SERVICE, CachedConnectionManager.class, dataSourceService.getCcmInjector()); dataSourceServiceBuilder.addDependency(driverServiceName, Driver.class, dataSourceService.getDriverInjector());
@Override protected void performRuntime(OperationContext context, ModelNode operation, ModelNode recoveryEnvModel) throws OperationFailedException { final String configPropertyValue = CONFIG_PROPERTY_VALUE.resolveModelAttribute(context, recoveryEnvModel).asString(); final ModelNode address = operation.require(OP_ADDR); PathAddress path = PathAddress.pathAddress(address); final String archiveName = path.getElement(path.size() -2).getValue(); final String configPropertyName = PathAddress.pathAddress(address).getLastElement().getValue(); ServiceName serviceName = ServiceName.of(ConnectorServices.RA_SERVICE, archiveName, configPropertyName); ServiceName raServiceName = ServiceName.of(ConnectorServices.RA_SERVICE, archiveName); final ServiceTarget serviceTarget = context.getServiceTarget(); final ConfigPropertiesService service = new ConfigPropertiesService(configPropertyName, configPropertyValue); serviceTarget.addService(serviceName, service).setInitialMode(ServiceController.Mode.ACTIVE) .addDependency(raServiceName, ModifiableResourceAdapter.class, service.getRaInjector() ) .install(); } }
final ServiceTarget target = context.getServiceTarget(); ModelNode initializeJaccNode = SecuritySubsystemRootResourceDefinition.INITIALIZE_JACC.resolveModelAttribute(context,model); final SecurityBootstrapService bootstrapService = new SecurityBootstrapService(initializeJaccNode.asBoolean()); target.addService(SecurityBootstrapService.SERVICE_NAME, bootstrapService) .addDependency(Services.JBOSS_SERVICE_MODULE_LOADER, ServiceModuleLoader.class, bootstrapService.getServiceModuleLoaderInjectedValue()) .setInitialMode(ServiceController.Mode.ACTIVE).install(); final BinderService binderService = new BinderService("jaas"); binderService.getManagedObjectInjector().inject(securityDomainJndiInjectable); target.addService(ContextNames.JBOSS_CONTEXT_SERVICE_NAME.append("jaas"), binderService) .addDependency(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, ServiceBasedNamingStore.class, binderService.getNamingStoreInjector()) .addDependency(SecurityManagementService.SERVICE_NAME, ISecurityManagement.class, securityDomainJndiInjectable.getSecurityManagementInjector()) .install(); ModelNode modelNode = SecuritySubsystemRootResourceDefinition.DEEP_COPY_SUBJECT_MODE.resolveModelAttribute(context,model); final SecurityManagementService securityManagementService = new SecurityManagementService( AUTHENTICATION_MANAGER, modelNode.isDefined() && modelNode.asBoolean(), CALLBACK_HANDLER, AUTHORIZATION_MANAGER, AUDIT_MANAGER, IDENTITY_TRUST_MANAGER, MAPPING_MANAGER); final ServiceBuilder securityManagementServiceSB = target.addService(SecurityManagementService.SERVICE_NAME, securityManagementService); securityManagementServiceSB.addDependency(Services.JBOSS_SERVICE_MODULE_LOADER, ServiceModuleLoader.class, securityManagementService.getServiceModuleLoaderInjectedValue()); securityManagementServiceSB.requires(JaasConfigurationService.SERVICE_NAME); // We need to ensure the global JAAS Configuration has been set. securityManagementServiceSB.setInitialMode(ServiceController.Mode.ACTIVE).install(); .addAliases(SubjectFactoryService.SERVICE_NAME) .addDependency(SecurityManagementService.SERVICE_NAME, ISecurityManagement.class, subjectFactoryService.getSecurityManagementInjector()) .setInitialMode(ServiceController.Mode.ACTIVE).install(); .setInitialMode(ServiceController.Mode.ACTIVE).install();
@Override protected void performRuntime(OperationContext context, ModelNode operation, ModelNode strictMaxPoolModel) throws OperationFailedException { final String poolName = PathAddress.pathAddress(operation.get(ModelDescriptionConstants.ADDRESS)).getLastElement().getValue(); final int maxPoolSize = StrictMaxPoolResourceDefinition.MAX_POOL_SIZE.resolveModelAttribute(context, strictMaxPoolModel).asInt(); final Derive derive = StrictMaxPoolResourceDefinition.parseDeriveSize(context, strictMaxPoolModel); final long timeout = StrictMaxPoolResourceDefinition.INSTANCE_ACQUISITION_TIMEOUT.resolveModelAttribute(context, strictMaxPoolModel).asLong(); final String unit = StrictMaxPoolResourceDefinition.INSTANCE_ACQUISITION_TIMEOUT_UNIT.resolveModelAttribute(context, strictMaxPoolModel).asString(); // create and install the service final StrictMaxPoolConfigService poolConfigService = new StrictMaxPoolConfigService(poolName, maxPoolSize, derive, timeout, TimeUnit.valueOf(unit)); final ServiceName serviceName = StrictMaxPoolConfigService.EJB_POOL_CONFIG_BASE_SERVICE_NAME.append(poolName); ServiceBuilder<StrictMaxPoolConfig> svcBuilder = context.getServiceTarget().addService(serviceName, poolConfigService); if (context.hasOptionalCapability(IO_MAX_THREADS_RUNTIME_CAPABILITY_NAME, null, null)) { ServiceName name = context.getCapabilityServiceName(IO_MAX_THREADS_RUNTIME_CAPABILITY_NAME, Integer.class); svcBuilder.addDependency(name, Integer.class, poolConfigService.getMaxThreadsInjector()); } svcBuilder.install(); }
final String securityDomainName = dsSecurityConfig.getSecurityDomain(); if (!elytronEnabled && securityDomainName != null) { builder.requires(SecurityDomainService.SERVICE_NAME.append(securityDomainName)); if (credential != null) { final String securityDomainName = credential.getSecurityDomain(); if (!RECOVERY_ELYTRON_ENABLED.resolveModelAttribute(context, model).asBoolean() && securityDomainName != null) { builder.requires(SecurityDomainService.SERVICE_NAME.append(securityDomainName)); propertiesCount++; xaConfigPropertyController.setMode(ServiceController.Mode.ACTIVE); builder.addDependency(name, String.class, xaDataSourceConfigService.getXaDataSourcePropertyInjector(xaPropService.getName())); builder.install(); final String securityDomainName = dsSecurityConfig.getSecurityDomain(); if (!elytronEnabled && securityDomainName != null) { builder.requires(SecurityDomainService.SERVICE_NAME.append(securityDomainName)); builder.addDependency(name, String.class, configService.getConnectionPropertyInjector(connPropService.getName())); builder.install(); final ServiceBuilder statsServiceSB = serviceTarget.addService(dataSourceServiceName.append(Constants.STATISTICS), statsService); statsServiceSB.addAliases(dataSourceServiceNameAlias); statsServiceSB.requires(dataSourceServiceName); statsServiceSB.addDependency(CommonDeploymentService.getServiceName( ContextNames.bindInfoFor(jndiName)), CommonDeployment.class, statsService.getCommonDeploymentInjector()); statsServiceSB.setInitialMode(ServiceController.Mode.PASSIVE); statsServiceSB.install();
@Override protected void performRuntime(final OperationContext context, final ModelNode operation, final ModelNode model) throws OperationFailedException { final boolean enabled = TracerDefinition.TracerParameters.TRACER_ENABLED.getAttribute().resolveModelAttribute(context, model).asBoolean(); ServiceName serviceName = ConnectorServices.TRACER_CONFIG_SERVICE; ServiceName jcaConfigServiceName = ConnectorServices.CONNECTOR_CONFIG_SERVICE; final ServiceTarget serviceTarget = context.getServiceTarget(); final TracerService.Tracer config = new TracerService.Tracer(enabled); final TracerService service = new TracerService(config); serviceTarget.addService(serviceName, service).setInitialMode(ServiceController.Mode.ACTIVE) .addDependency(jcaConfigServiceName, JcaSubsystemConfiguration.class, service.getJcaConfigInjector()) .install(); } }
final String defaultWebModule = HostDefinition.DEFAULT_WEB_MODULE.resolveModelAttribute(context, model).asString(); final String defaultServerName = UndertowRootDefinition.DEFAULT_SERVER.resolveModelAttribute(context, subsystemModel).asString(); final String defaultHostName = ServerDefinition.DEFAULT_HOST.resolveModelAttribute(context, serverModel).asString(); final String serverName = serverAddress.getLastElement().getValue(); final boolean isDefaultHost = defaultServerName.equals(serverName) && name.equals(defaultHostName); .addDependency(ControlledProcessStateService.SERVICE_NAME, ControlledProcessStateService.class, service.getControlledProcessStateServiceInjectedValue()); builder.setInitialMode(Mode.ON_DEMAND); builder.addAliases(UndertowService.DEFAULT_HOST);//add alias for default host of default server service builder.addAliases(UndertowService.virtualHostName(serverName, name)); builder.install(); if (context.getProcessType() == ProcessType.STANDALONE_SERVER) { final ConsoleRedirectService redirectService = new ConsoleRedirectService(); final ServiceBuilder<ConsoleRedirectService> redirectBuilder = context.getServiceTarget().addService(consoleRedirectName, redirectService) .addDependency(UndertowHttpManagementService.SERVICE_NAME, HttpManagement.class, redirectService.getHttpManagementInjector()) .addDependency(virtualHostServiceName, Host.class, redirectService.getHostInjector()) .setInitialMode(Mode.PASSIVE); redirectBuilder.install(); } else { final ServiceBuilder<ConsoleRedirectService> redirectBuilder = context.getServiceTarget().addService(consoleRedirectName, redirectService) .addDependency(virtualHostServiceName, Host.class, redirectService.getHostInjector()) .setInitialMode(Mode.PASSIVE); redirectBuilder.install();
@Override protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { final String name = PathAddress.pathAddress(operation.get(ModelDescriptionConstants.ADDRESS)).getLastElement().getValue(); final String jndiName = ManagedExecutorServiceResourceDefinition.JNDI_NAME_AD.resolveModelAttribute(context, model).asString(); final int priority = ManagedThreadFactoryResourceDefinition.PRIORITY_AD.resolveModelAttribute(context, model).asInt(); final ManagedThreadFactoryService service = new ManagedThreadFactoryService(name, jndiName, priority); final ServiceBuilder<ManagedThreadFactoryImpl> serviceBuilder = context.getServiceTarget().addService(ConcurrentServiceNames.getManagedThreadFactoryServiceName(name), service); String contextService = null; if(model.hasDefined(ManagedThreadFactoryResourceDefinition.CONTEXT_SERVICE)) { contextService = ManagedThreadFactoryResourceDefinition.CONTEXT_SERVICE_AD.resolveModelAttribute(context, model).asString(); } if (contextService != null) { serviceBuilder.addDependency(ConcurrentServiceNames.getContextServiceServiceName(contextService), ContextServiceImpl.class, service.getContextServiceInjector()); } serviceBuilder.install(); } }
@Override protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { // Cache the TransactionManager service name for use by our runtime services ConnectorServices.registerCapabilityServiceName(LOCAL_TRANSACTION_PROVIDER_CAPABILITY, context.getCapabilityServiceName(LOCAL_TRANSACTION_PROVIDER_CAPABILITY, null)); final Resource subsystemResource = context.readResourceFromRoot(PathAddress.pathAddress(ResourceAdaptersExtension.SUBSYSTEM_PATH)); ResourceAdaptersSubsystemService service = new ResourceAdaptersSubsystemService(); CopyOnWriteArrayListMultiMap<String, ServiceName> value = service.getValue(); for (Resource.ResourceEntry re : subsystemResource.getChildren(RESOURCEADAPTER_NAME)) { value.putIfAbsent(re.getModel().get(ARCHIVE.getName()).asString(), ConnectorServices.RA_SERVICE.append(re.getName())); } final ServiceBuilder<?> builder = context.getServiceTarget().addService(ConnectorServices.RESOURCEADAPTERS_SUBSYSTEM_SERVICE, service); builder.setInitialMode(ServiceController.Mode.ACTIVE).install(); } }
@Override protected void performRuntime(OperationContext context, ModelNode operation, Resource resource) throws OperationFailedException { ModelNode model = resource.getModel(); final String name = PathAddress.pathAddress(operation.get(ModelDescriptionConstants.ADDRESS)).getLastElement().getValue(); final String jndiName = ContextServiceResourceDefinition.JNDI_NAME_AD.resolveModelAttribute(context, model).asString(); final boolean useTransactionSetupProvider = ContextServiceResourceDefinition.USE_TRANSACTION_SETUP_PROVIDER_AD.resolveModelAttribute(context, model).asBoolean(); // install the service which manages the default context service final ContextServiceService contextServiceService = new ContextServiceService(name, jndiName, new DefaultContextSetupProviderImpl()); final ServiceBuilder<ContextServiceImpl> serviceBuilder = context.getServiceTarget().addService(ConcurrentServiceNames.getContextServiceServiceName(name), contextServiceService); if (useTransactionSetupProvider) { // add it to deps of context service's service, for injection of its value serviceBuilder.addDependency(ConcurrentServiceNames.TRANSACTION_SETUP_PROVIDER_SERVICE_NAME,TransactionSetupProvider.class,contextServiceService.getTransactionSetupProvider()); } serviceBuilder.install(); } }
@Override protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { final PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR)); final String name = address.getLastElement().getValue(); int bufferSize = BufferCacheDefinition.BUFFER_SIZE.resolveModelAttribute(context, model).asInt(); int buffersPerRegions = BufferCacheDefinition.BUFFERS_PER_REGION.resolveModelAttribute(context, model).asInt(); int maxRegions = BufferCacheDefinition.MAX_REGIONS.resolveModelAttribute(context, model).asInt(); final BufferCacheService service = new BufferCacheService(bufferSize, buffersPerRegions, maxRegions); final ServiceTarget target = context.getServiceTarget(); target.addService(BufferCacheService.SERVICE_NAME.append(name), service) .setInitialMode(ServiceController.Mode.ON_DEMAND) .install(); } }
final ServiceName deploymentInfoServiceName = deploymentServiceName.append(UndertowDeploymentInfoService.SERVICE_NAME); final ServiceName legacyDeploymentInfoServiceName = legacyDeploymentServiceName.append(UndertowDeploymentInfoService.SERVICE_NAME); ServiceBuilder<DeploymentInfo> infoBuilder = serviceTarget.addService(deploymentInfoServiceName, undertowDeploymentInfoService) .addAliases(legacyDeploymentInfoServiceName) .addDependency(UndertowService.SERVLET_CONTAINER.append(servletContainerName), ServletContainerService.class, undertowDeploymentInfoService.getContainer()) .addDependency(UndertowService.UNDERTOW, UndertowService.class, undertowDeploymentInfoService.getUndertowService()) .addDependency(hostServiceName, Host.class, undertowDeploymentInfoService.getHost()) .addDependency(ServerEnvironmentService.SERVICE_NAME, ServerEnvironment.class, undertowDeploymentInfoService.getServerEnvironmentInjectedValue()) .addDependency(SuspendController.SERVICE_NAME, SuspendController.class, undertowDeploymentInfoService.getSuspendControllerInjectedValue()); for (final ServiceName additionalDependency : additionalDependencies) { infoBuilder.requires(additionalDependency); infoBuilder.addDependency( deploymentUnit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT) .getCapabilityServiceName( BiFunction.class, undertowDeploymentInfoService.getSecurityFunctionInjector()); } else { infoBuilder.addDependency(SecurityDomainService.SERVICE_NAME.append(securityDomain), SecurityDomainContext.class, undertowDeploymentInfoService.getSecurityDomainContextValue()); infoBuilder.addDependency(ControlPointService.serviceName(topLevelName, UndertowExtension.SUBSYSTEM_NAME), ControlPoint.class, undertowDeploymentInfoService.getControlPointInjectedValue()); infoBuilder.addDependency(IOServices.WORKER.append(metaData.getExecutorName()), Executor.class, executor); undertowDeploymentInfoService.addInjectedExecutor(metaData.getExecutorName(), executor); seenExecutors.add(metaData.getExecutorName()); if (servlet.getExecutorName() != null && !seenExecutors.contains(servlet.getExecutorName())) { final InjectedValue<Executor> executor = new InjectedValue<Executor>(); infoBuilder.addDependency(IOServices.WORKER.append(servlet.getExecutorName()), Executor.class, executor);
@Override protected void performBoottime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { Map<String, Object> vaultOptions = new HashMap<String, Object>(); ModelNode vaultClassNode = CODE.resolveModelAttribute(context, model); String vaultClass = vaultClassNode.getType() == ModelType.UNDEFINED ? null : vaultClassNode.asString(); if (operation.hasDefined(Constants.VAULT_OPTIONS)) { for (Map.Entry<String,String> vaultOption : OPTIONS.unwrap(context,model).entrySet()) { vaultOptions.put(vaultOption.getKey(), vaultOption.getValue()); } } // add security vault service if (vaultClass != null || !vaultOptions.isEmpty()) { final SecurityVaultService vaultService = new SecurityVaultService(vaultClass, vaultOptions); context.getServiceTarget() .addService(SecurityVaultService.SERVICE_NAME, vaultService) .setInitialMode(ServiceController.Mode.ACTIVE).install(); } } }