model.get(CACHED_CONNECTION_MANAGER_ERROR).set(ccmError);
}
}
protected void performBoottime(OperationContext context, ModelNode operation, ModelNode model, ServiceVerificationHandler verificationHandler, List<ServiceController<?>> newControllers) {
final RaDeploymentActivator deploymentActivator = new RaDeploymentActivator();
context.addStep(new AbstractDeploymentChainStep() {
protected void execute(DeploymentProcessorTarget processorTarget) {
deploymentActivator.activateProcessors(processorTarget);
}
}, OperationContext.Stage.RUNTIME);
final boolean archiveValidationEnabled = ParamsUtils
.parseBooleanParameter(operation, ARCHIVE_VALIDATION_ENABLED, false);
final boolean failOnError = ParamsUtils.parseBooleanParameter(operation, ARCHIVE_VALIDATION_FAIL_ON_ERROR, true);
final boolean failOnWarn = ParamsUtils.parseBooleanParameter(operation, ARCHIVE_VALIDATION_FAIL_ON_WARN, false);
final boolean ccmDebug = ParamsUtils.parseBooleanParameter(operation, CACHED_CONNECTION_MANAGER_DEBUG, false);
final boolean ccmError = ParamsUtils.parseBooleanParameter(operation, CACHED_CONNECTION_MANAGER_ERROR, false);
ServiceTarget serviceTarget = context.getServiceTarget();
TransactionIntegrationService tiService = new TransactionIntegrationService();
newControllers.add(serviceTarget
.addService(ConnectorServices.TRANSACTION_INTEGRATION_SERVICE, tiService)
.addDependency(TxnServices.JBOSS_TXN_TRANSACTION_MANAGER, TransactionManager.class, tiService.getTmInjector())
.addDependency(TxnServices.JBOSS_TXN_SYNCHRONIZATION_REGISTRY, TransactionSynchronizationRegistry.class, tiService.getTsrInjector())
.addDependency(TxnServices.JBOSS_TXN_USER_TRANSACTION_REGISTRY, org.jboss.tm.usertx.UserTransactionRegistry.class, tiService.getUtrInjector())
.addDependency(TxnServices.JBOSS_TXN_XA_TERMINATOR, JBossXATerminator.class, tiService.getTerminatorInjector())
.addDependency(TxnServices.JBOSS_TXN_ARJUNA_RECOVERY_MANAGER, XAResourceRecoveryRegistry.class, tiService.getRrInjector())
.addListener(verificationHandler)
.setInitialMode(Mode.ACTIVE)
.install());
CcmService ccmService = new CcmService(ccmDebug, ccmError);
newControllers.add(serviceTarget
.addService(ConnectorServices.CCM_SERVICE, ccmService)
.addDependency(ConnectorServices.TRANSACTION_INTEGRATION_SERVICE, TransactionIntegration.class,
ccmService.getTransactionIntegrationInjector())
.addListener(verificationHandler)
.install());
WorkManager wm = new WorkManagerImpl();
final WorkManagerService wmService = new WorkManagerService(wm);
newControllers.add(serviceTarget
.addService(ConnectorServices.WORKMANAGER_SERVICE, wmService)
.addDependency(ThreadsServices.EXECUTOR.append(SHORT_RUNNING_THREADS), Executor.class, wmService.getExecutorShortInjector())
.addDependency(ThreadsServices.EXECUTOR.append(LONG_RUNNING_THREADS), Executor.class, wmService.getExecutorLongInjector())
.addDependency(TxnServices.JBOSS_TXN_XA_TERMINATOR, JBossXATerminator.class, wmService.getXaTerminatorInjector())
.addListener(verificationHandler)
.setInitialMode(Mode.ACTIVE)
.install());
CloneableBootstrapContext ctx = new BaseCloneableBootstrapContext();
final DefaultBootStrapContextService defaultBootCtxService = new DefaultBootStrapContextService(ctx);
newControllers.add(serviceTarget
.addService(ConnectorServices.DEFAULT_BOOTSTRAP_CONTEXT_SERVICE, defaultBootCtxService)
.addDependency(ConnectorServices.WORKMANAGER_SERVICE, WorkManager.class, defaultBootCtxService.getWorkManagerValueInjector())
.addDependency(TxnServices.JBOSS_TXN_XA_TERMINATOR, JBossXATerminator.class, defaultBootCtxService.getXaTerminatorInjector())
.addDependency(TxnServices.JBOSS_TXN_ARJUNA_TRANSACTION_MANAGER, com.arjuna.ats.jbossatx.jta.TransactionManagerService.class, defaultBootCtxService.getTxManagerInjector())
.addListener(verificationHandler)
.setInitialMode(Mode.ACTIVE)
.install());
final JcaSubsystemConfiguration config = new JcaSubsystemConfiguration();
config.setArchiveValidation(archiveValidationEnabled);
config.setArchiveValidationFailOnError(failOnError);
config.setArchiveValidationFailOnWarn(failOnWarn);
// FIXME Bean validation currently not used
config.setBeanValidation(false);
final JcaConfigService connectorConfigService = new JcaConfigService(config);
newControllers.add(serviceTarget
.addService(ConnectorServices.CONNECTOR_CONFIG_SERVICE, connectorConfigService)
.addDependency(ConnectorServices.DEFAULT_BOOTSTRAP_CONTEXT_SERVICE,
CloneableBootstrapContext.class,
connectorConfigService.getDefaultBootstrapContextInjector())
.addListener(verificationHandler)
.setInitialMode(Mode.ACTIVE)
.install());
// TODO does the install of this and the DriverProcessor
// belong in DataSourcesSubsystemAdd?
final DriverRegistryService driverRegistryService = new DriverRegistryService();
newControllers.add(serviceTarget.addService(ConnectorServices.JDBC_DRIVER_REGISTRY_SERVICE, driverRegistryService)
.addListener(verificationHandler)
.install());
newControllers.addAll(deploymentActivator.activateServices(serviceTarget, verificationHandler));
}