private void performCoordinatorEnvBoottime(OperationContext context, ModelNode coordEnvModel, final boolean jts) throws OperationFailedException { final boolean coordinatorEnableStatistics = TransactionSubsystemRootResourceDefinition.STATISTICS_ENABLED.resolveModelAttribute(context, coordEnvModel).asBoolean(); final boolean transactionStatusManagerEnable = TransactionSubsystemRootResourceDefinition.ENABLE_TSM_STATUS.resolveModelAttribute(context, coordEnvModel).asBoolean(); final int coordinatorDefaultTimeout = TransactionSubsystemRootResourceDefinition.DEFAULT_TIMEOUT.resolveModelAttribute(context, coordEnvModel).asInt(); final int maximumTimeout = TransactionSubsystemRootResourceDefinition.MAXIMUM_TIMEOUT.resolveModelAttribute(context, coordEnvModel).asInt(); // WFLY-9955 Allow the timeout set to "0" while translating into the maximum timeout if (coordinatorDefaultTimeout == 0) { ContextTransactionManager.setGlobalDefaultTransactionTimeout(maximumTimeout); TransactionLogger.ROOT_LOGGER.timeoutValueIsSetToMaximum(maximumTimeout); } else { ContextTransactionManager.setGlobalDefaultTransactionTimeout(coordinatorDefaultTimeout); } final ArjunaTransactionManagerService transactionManagerService = new ArjunaTransactionManagerService(coordinatorEnableStatistics, coordinatorDefaultTimeout, transactionStatusManagerEnable, jts); final ServiceBuilder<com.arjuna.ats.jbossatx.jta.TransactionManagerService> transactionManagerServiceServiceBuilder = context.getServiceTarget().addService(TxnServices.JBOSS_TXN_ARJUNA_TRANSACTION_MANAGER, transactionManagerService); // add dependency on JTA environment bean service transactionManagerServiceServiceBuilder.addDependency(TxnServices.JBOSS_TXN_JTA_ENVIRONMENT, JTAEnvironmentBean.class, transactionManagerService.getJTAEnvironmentBeanInjector()); //if jts is enabled we need the ORB if (jts) { transactionManagerServiceServiceBuilder.addDependency(ServiceName.JBOSS.append("iiop-openjdk", "orb-service"), ORB.class, transactionManagerService.getOrbInjector()); transactionManagerServiceServiceBuilder.requires(CorbaNamingService.SERVICE_NAME); } transactionManagerServiceServiceBuilder.addDependency(TxnServices.JBOSS_TXN_XA_TERMINATOR, JBossXATerminator.class, transactionManagerService.getXaTerminatorInjector()); transactionManagerServiceServiceBuilder.addDependency(TxnServices.JBOSS_TXN_USER_TRANSACTION_REGISTRY, UserTransactionRegistry.class, transactionManagerService.getUserTransactionRegistry()); transactionManagerServiceServiceBuilder.requires(TxnServices.JBOSS_TXN_CORE_ENVIRONMENT); transactionManagerServiceServiceBuilder.requires(TxnServices.JBOSS_TXN_ARJUNA_OBJECTSTORE_ENVIRONMENT); transactionManagerServiceServiceBuilder.requires(XA_RESOURCE_RECOVERY_REGISTRY_CAPABILITY.getCapabilityServiceName()); transactionManagerServiceServiceBuilder.setInitialMode(ServiceController.Mode.ACTIVE); transactionManagerServiceServiceBuilder.install(); }
@Override protected void performRuntime(OperationContext context, ModelNode operation, final Resource resource) throws OperationFailedException { if (!raModel.hasDefined(ARCHIVE.getName()) && !raModel.hasDefined(MODULE.getName())) { throw ConnectorLogger.ROOT_LOGGER.archiveOrModuleRequired(); ServiceName serviceName = ServiceName.of(ConnectorServices.RA_SERVICE, raName, poolName); ServiceName raServiceName = ServiceName.of(ConnectorServices.RA_SERVICE, raName); final ServiceTarget serviceTarget = context.getServiceTarget(); serviceTarget.addService(serviceName, service).setInitialMode(ServiceController.Mode.ACTIVE) .addDependency(raServiceName, ModifiableResourceAdapter.class, service.getRaInjector()) .install(); ServiceRegistry registry = context.getServiceRegistry(true); final ServiceController<?> RaxmlController = registry.getService(ServiceName.of(ConnectorServices.RA_SERVICE, raName)); Activation raxml = (Activation) RaxmlController.getValue(); ServiceName deploymentServiceName = ConnectorServices.getDeploymentServiceName(archiveOrModuleName, raName); AdminObjectStatisticsService adminObjectStatisticsService = new AdminObjectStatisticsService(context.getResourceRegistrationForUpdate(), poolName, statsEnabled); ServiceBuilder statsServiceBuilder = serviceTarget.addService(serviceName.append(ConnectorServices.STATISTICS_SUFFIX), adminObjectStatisticsService); statsServiceBuilder.addDependency(ConnectorServices.BOOTSTRAP_CONTEXT_SERVICE.append(bootStrapCtxName), Object.class, adminObjectStatisticsService.getBootstrapContextInjector()) .addDependency(deploymentServiceName, Object.class, adminObjectStatisticsService.getResourceAdapterDeploymentInjector())
@Override public Lifecycle apply(ServiceTarget target) { Lifecycle primaryLifecycle = new ServiceLifecycle(target.addService(this.name.append("primary"), this.primaryService).setInitialMode(ServiceController.Mode.NEVER).install()); Lifecycle backupLifecycle = new ServiceLifecycle(target.addService(this.name.append("backup"), this.backupService).setInitialMode(ServiceController.Mode.ACTIVE).install()); return new PrimaryBackupLifecycle(primaryLifecycle, backupLifecycle); } }
final String name = context.getCurrentAddressValue(); final String archiveOrModuleName; final boolean statsEnabled = STATISTICS_ENABLED.resolveModelAttribute(context, model).asBoolean(); } else { RaOperationUtil.installRaServicesAndDeployFromModule(context, name, resourceAdapter, archiveOrModuleName, newControllers); if (context.isBooting()) { context.addStep(new OperationStepHandler() { public void execute(final OperationContext context, ModelNode operation) throws OperationFailedException { ServiceRegistry registry = context.getServiceRegistry(true); final ServiceController<?> RaxmlController = registry.getService(ServiceName.of(ConnectorServices.RA_SERVICE, name)); Activation raxml = (Activation) RaxmlController.getValue(); ServiceName serviceName = ConnectorServices.getDeploymentServiceName(archiveOrModuleName, name); ResourceAdapterStatisticsService raStatsService = new ResourceAdapterStatisticsService(context.getResourceRegistrationForUpdate(), name, statsEnabled); ServiceBuilder statsServiceBuilder = context.getServiceTarget().addService(ServiceName.of(ConnectorServices.RA_SERVICE, name).append(ConnectorServices.STATISTICS_SUFFIX), raStatsService); statsServiceBuilder.addDependency(ConnectorServices.BOOTSTRAP_CONTEXT_SERVICE.append(bootStrapCtxName), Object.class, raStatsService.getBootstrapContextInjector()) .addDependency(serviceName, Object.class, raStatsService.getResourceAdapterDeploymentInjector()) .setInitialMode(ServiceController.Mode.PASSIVE) .install();
@Override protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { boolean rcPresent = context.readResourceFromRoot(PathAddress.EMPTY_ADDRESS, false).hasChild(PathElement.pathElement(ModelDescriptionConstants.SUBSYSTEM, RequestControllerExtension.SUBSYSTEM_NAME)); final String name = PathAddress.pathAddress(operation.get(ModelDescriptionConstants.ADDRESS)).getLastElement().getValue(); final String jndiName = ManagedExecutorServiceResourceDefinition.JNDI_NAME_AD.resolveModelAttribute(context, model).asString(); final long hungTaskThreshold = ManagedScheduledExecutorServiceResourceDefinition.HUNG_TASK_THRESHOLD_AD.resolveModelAttribute(context, model).asLong(); final boolean longRunningTasks = ManagedScheduledExecutorServiceResourceDefinition.LONG_RUNNING_TASKS_AD.resolveModelAttribute(context, model).asBoolean(); final ServiceBuilder<ManagedScheduledExecutorServiceAdapter> serviceBuilder = context.getServiceTarget().addService(ConcurrentServiceNames.getManagedScheduledExecutorServiceServiceName(name), service); serviceBuilder.addDependency(ConcurrentServiceNames.getContextServiceServiceName(contextService), ContextServiceImpl.class, service.getContextServiceInjector()); serviceBuilder.addDependency(ConcurrentServiceNames.getManagedThreadFactoryServiceName(threadFactory), ManagedThreadFactoryImpl.class, service.getManagedThreadFactoryInjector()); serviceBuilder.addDependency(RequestController.SERVICE_NAME, RequestController.class, service.getRequestController());
final RemotingProfileService profileService = new RemotingProfileService(urls, map); final ServiceBuilder<RemotingProfileService> builder = context.getServiceTarget().addService(profileServiceName, profileService); if (profileNode.hasDefined(EJB3SubsystemModel.REMOTING_EJB_RECEIVER)) { for (final Property receiverProperty : profileNode.get(EJB3SubsystemModel.REMOTING_EJB_RECEIVER) .asPropertyList()) { final ModelNode receiverNode = receiverProperty.getValue(); final String connectionRef = RemotingEjbReceiverDefinition.OUTBOUND_CONNECTION_REF.resolveModelAttribute(context, receiverNode).asString(); final long timeout = RemotingEjbReceiverDefinition.CONNECT_TIMEOUT.resolveModelAttribute(context, receiverNode).asLong(); .append(connectionRef); final InjectedValue<AbstractOutboundConnectionService> connectionInjector = new InjectedValue<AbstractOutboundConnectionService>(); builder.addDependency(connectionDependencyService, AbstractOutboundConnectionService.class, connectionInjector); final ModelNode channelCreationOptionsNode = receiverNode.get(EJB3SubsystemModel.CHANNEL_CREATION_OPTIONS); .resolveModelAttribute(context, profileNode).asBoolean(); final ServiceName localTransportProviderServiceName = passByValueNode.asBoolean() == true ? LocalTransportProvider.BY_VALUE_SERVICE_NAME : LocalTransportProvider.BY_REFERENCE_SERVICE_NAME; builder.addDependency(localTransportProviderServiceName, EJBTransportProvider.class, profileService.getLocalTransportProviderInjector()); } else { builder.addDependency(LocalTransportProvider.DEFAULT_LOCAL_TRANSPORT_PROVIDER_SERVICE_NAME, EJBTransportProvider.class, profileService.getLocalTransportProviderInjector());
/** * {@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(); } } }
void firstRuntimeStep(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { final String jndiName = JNDI_NAME.resolveModelAttribute(context, model).asString(); final ContextNames.BindInfo bindInfo = ContextNames.bindInfoFor(jndiName); final boolean jta = JTA.resolveModelAttribute(context, operation).asBoolean(); final String dsName = context.getCurrentAddressValue();// The STATISTICS_ENABLED.resolveModelAttribute(context, model) call should remain as it serves to validate that any final boolean statsEnabled = STATISTICS_ENABLED.resolveModelAttribute(context, model).asBoolean(); final ServiceTarget serviceTarget = context.getServiceTarget(); final String driverName = node.asString(); final ServiceName driverServiceName = ServiceName.JBOSS.append("jdbc-driver", driverName.replaceAll("\\.", "_")); 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); final ManagementResourceRegistration registration = context.getResourceRegistrationForUpdate(); final ServiceName dataSourceServiceNameAlias = AbstractDataSourceService.getServiceName(bindInfo); final ServiceName dataSourceServiceName = context.getCapabilityServiceName(Capabilities.DATA_SOURCE_CAPABILITY_NAME, dsName, DataSource.class); final ServiceBuilder<?> dataSourceServiceBuilder = Services.addServerExecutorDependency( serviceTarget.addService(dataSourceServiceName, dataSourceService), dataSourceService.getExecutorServiceInjector()) .addAliases(dataSourceServiceNameAlias) .addDependency(ConnectorServices.MANAGEMENT_REPOSITORY_SERVICE, ManagementRepository.class, dataSourceService.getManagementRepositoryInjector())
@Override protected void performRuntime(final OperationContext context, final ModelNode operation, final ModelNode model) throws OperationFailedException { final String jndiName = DatabaseDataStoreResourceDefinition.DATASOURCE_JNDI_NAME.resolveModelAttribute(context, model).asString(); final ModelNode dataBaseValue = DatabaseDataStoreResourceDefinition.DATABASE.resolveModelAttribute(context, model); final String database; if(dataBaseValue.isDefined()) { database = dataBaseValue.asString(); } else { database = null; } final String partition = DatabaseDataStoreResourceDefinition.PARTITION.resolveModelAttribute(context, model).asString(); final String name = PathAddress.pathAddress(operation.get(OP_ADDR)).getLastElement().getValue(); int refreshInterval = DatabaseDataStoreResourceDefinition.REFRESH_INTERVAL.resolveModelAttribute(context, model).asInt(); boolean allowExecution = DatabaseDataStoreResourceDefinition.ALLOW_EXECUTION.resolveModelAttribute(context, model).asBoolean(); final String nodeName = WildFlySecurityManager.getPropertyPrivileged(ServerEnvironment.NODE_NAME, null); final DatabaseTimerPersistence databaseTimerPersistence = new DatabaseTimerPersistence(database, partition, nodeName, refreshInterval, allowExecution); final ServiceName serviceName = TimerPersistence.SERVICE_NAME.append(name); context.getServiceTarget().addService(serviceName, databaseTimerPersistence) .addDependency(Services.JBOSS_SERVICE_MODULE_LOADER, ModuleLoader.class, databaseTimerPersistence.getModuleLoader()) .addDependency(ContextNames.bindInfoFor(jndiName).getBinderServiceName(), ManagedReferenceFactory.class, databaseTimerPersistence.getDataSourceInjectedValue()) .addDependency(TimerServiceDeploymentProcessor.TIMER_SERVICE_NAME, java.util.Timer.class, databaseTimerPersistence.getTimerInjectedValue()) .install(); }
private void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { if (isEnabled(context, model)) { ModelNode pathValue = PATH.resolveModelAttribute(context, model); ServiceBuilder<SessionPersistenceManager> builder; if (pathValue.isDefined()) { String path = pathValue.asString(); ModelNode relativeToValue = RELATIVE_TO.resolveModelAttribute(context, model); String relativeTo = relativeToValue.isDefined() ? relativeToValue.asString() : null; final DiskBasedModularPersistentSessionManager service = new DiskBasedModularPersistentSessionManager(path, relativeTo); builder = context.getServiceTarget().addService(AbstractPersistentSessionManager.SERVICE_NAME, service) .addDependency(Services.JBOSS_SERVICE_MODULE_LOADER, ModuleLoader.class, service.getModuleLoaderInjectedValue()) .addDependency(PathManagerService.SERVICE_NAME, PathManager.class, service.getPathManager()); } else { final InMemoryModularPersistentSessionManager service = new InMemoryModularPersistentSessionManager(); builder = context.getServiceTarget().addService(AbstractPersistentSessionManager.SERVICE_NAME, service) .addDependency(Services.JBOSS_SERVICE_MODULE_LOADER, ModuleLoader.class, service.getModuleLoaderInjectedValue()); } builder.install(); } }
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(); }
@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(); } }
@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(); }
@Override protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { String securityDomain = SECURITY_DOMAIN.resolveModelAttribute(context, model).asString(); boolean enableJacc = ENABLE_JACC.resolveModelAttribute(context, model).asBoolean(); RuntimeCapability<?> runtimeCapability = APPLICATION_SECURITY_DOMAIN_RUNTIME_CAPABILITY.fromBaseCapability(context.getCurrentAddressValue()); ServiceName serviceName = runtimeCapability.getCapabilityServiceName(ApplicationSecurityDomain.class); ApplicationSecurityDomainService applicationSecurityDomainService = new ApplicationSecurityDomainService(enableJacc); ServiceBuilder<ApplicationSecurityDomain> serviceBuilder = context.getServiceTarget().addService(serviceName, applicationSecurityDomainService) .setInitialMode(Mode.LAZY); serviceBuilder.addDependency(context.getCapabilityServiceName( SECURITY_DOMAIN_CAPABILITY, securityDomain, SecurityDomain.class), SecurityDomain.class, applicationSecurityDomainService.getSecurityDomainInjector()); if (model.hasDefined(ENABLE_JACC.getName())) { if (ENABLE_JACC.resolveModelAttribute(context, model).asBoolean()) { serviceBuilder.requires(context.getCapabilityServiceName(JACC_POLICY_CAPABILITY, Policy.class)); } } serviceBuilder.install(); } }
@Override protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { final PathAddress address = context.getCurrentAddress(); final String name = context.getCurrentAddressValue(); final String serverName = serverAddress.getLastElement().getValue(); final String hostName = hostAddress.getLastElement().getValue(); locationService = context.getCapabilityServiceName(Capabilities.CAPABILITY_HOST, FilterLocation.class, serverName, hostName); } else { final PathAddress locationAddress = address.getParent(); if (model.hasDefined(PREDICATE.getName())) { String predicateString = model.get(PREDICATE.getName()).asString(); predicate = PredicateParser.parse(predicateString, getClass().getClassLoader()); final FilterRef service = new FilterRef(predicate, priority); final ServiceTarget target = context.getServiceTarget(); target.addService(UndertowService.getFilterRefServiceName(address, name), service) .addDependency(UndertowService.FILTER.append(name), FilterService.class, service.getFilter()) .addDependency(locationService, FilterLocation.class, service.getLocation()) .setInitialMode(ServiceController.Mode.ACTIVE) .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) 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); target.addService(SUBJECT_FACTORY_CAP.getCapabilityServiceName(), subjectFactoryService) target.addService(JaasConfigurationService.SERVICE_NAME, jaasConfigurationService) if(context.hasOptionalCapability("org.wildfly.transactions", SECURITY_SUBSYSTEM.getName(), null)) { TransactionManagerLocatorService service = new TransactionManagerLocatorService(); target.addService(TransactionManagerLocatorService.SERVICE_NAME, service) .addDependency( ServiceName.JBOSS.append("txn", "TransactionManager"), TransactionManager.class, service.getTransactionManagerInjectedValue()) target.addService(TransactionManagerLocatorService.SERVICE_NAME, Service.NULL).install(); final ServiceBuilder simpleSecurityManagerServiceSB = target.addService(SERVER_SECURITY_MANAGER.getCapabilityServiceName(), simpleSecurityManagerService);
throws OperationFailedException { final boolean rcPresent = context.readResourceFromRoot(PathAddress.EMPTY_ADDRESS, false).hasChild(PathElement.pathElement(ModelDescriptionConstants.SUBSYSTEM, RequestControllerExtension.SUBSYSTEM_NAME)); context.addStep(new AbstractDeploymentChainStep() { public void execute(DeploymentProcessorTarget processorTarget) { processorTarget.addDeploymentProcessor(BatchSubsystemDefinition.NAME, final ModelNode defaultJobRepository = DEFAULT_JOB_REPOSITORY.resolveModelAttribute(context, model); final ModelNode defaultThreadPool = DEFAULT_THREAD_POOL.resolveModelAttribute(context, model); final ModelNode securityDomain = SECURITY_DOMAIN.resolveModelAttribute(context, model); final boolean restartOnResume = RESTART_JOBS_ON_RESUME.resolveModelAttribute(context, model).asBoolean(); final ServiceTarget target = context.getServiceTarget(); final BatchConfigurationService service = new BatchConfigurationService(); service.setRestartOnResume(restartOnResume); final ServiceBuilder<BatchConfiguration> serviceBuilder = target.addService(context.getCapabilityServiceName(Capabilities.BATCH_CONFIGURATION_CAPABILITY.getName(), BatchConfiguration.class), service) .addDependency( context.getCapabilityServiceName(Capabilities.JOB_REPOSITORY_CAPABILITY.getName(), defaultJobRepository.asString(), JobRepository.class), JobRepository.class, service.getJobRepositoryInjector()
@Override protected void performBoottime(final OperationContext context, final ModelNode operation, final ModelNode model) throws OperationFailedException { final Boolean enableByDefault = EJB3IIOPResourceDefinition.ENABLE_BY_DEFAULT.resolveModelAttribute(context, model).asBoolean(); final Boolean useQualifiedName = EJB3IIOPResourceDefinition.USE_QUALIFIED_NAME.resolveModelAttribute(context, model).asBoolean(); final IIOPSettingsService settingsService = new IIOPSettingsService(enableByDefault, useQualifiedName); context.addStep(new AbstractDeploymentChainStep() { protected void execute(DeploymentProcessorTarget processorTarget) { ROOT_LOGGER.debug("Adding EJB IIOP support"); processorTarget.addDeploymentProcessor(EJB3Extension.SUBSYSTEM_NAME, Phase.POST_MODULE, Phase.POST_MODULE_EJB_IIOP, new EjbIIOPDeploymentUnitProcessor(settingsService)); } }, OperationContext.Stage.RUNTIME); context.getServiceTarget().addService(IIOPSettingsService.SERVICE_NAME, settingsService).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 recoveryEnvModel) throws OperationFailedException { final String configPropertyValue = CONNECTION_PROPERTY_VALUE.resolveModelAttribute(context, recoveryEnvModel).asString(); final ModelNode address = operation.require(OP_ADDR); PathAddress path = PathAddress.pathAddress(address); final String jndiName = path.getElement(path.size() - 2).getValue(); final String configPropertyName = PathAddress.pathAddress(address).getLastElement().getValue(); ServiceName serviceName = DataSourceConfigService.SERVICE_NAME_BASE.append(jndiName).append("connection-properties").append(configPropertyName); final ServiceRegistry registry = context.getServiceRegistry(true); final ServiceName dataSourceConfigServiceName = DataSourceConfigService.SERVICE_NAME_BASE .append(jndiName); final ServiceController<?> dataSourceConfigController = registry .getService(dataSourceConfigServiceName); if (dataSourceConfigController == null || !((DataSource) dataSourceConfigController.getValue()).isEnabled()) { final ServiceTarget serviceTarget = context.getServiceTarget(); final ConnectionPropertiesService service = new ConnectionPropertiesService(configPropertyName, configPropertyValue); serviceTarget.addService(serviceName, service).setInitialMode(ServiceController.Mode.NEVER) .install(); } else { context.reloadRequired(); } }