Search in sources :

Example 1 with TransactionManagerService

use of org.jboss.as.txn.service.TransactionManagerService in project wildfly by wildfly.

the class TransactionSubsystemAdd method performCoordinatorEnvBoottime.

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 String nodeIdentifier = TransactionSubsystemRootResourceDefinition.NODE_IDENTIFIER.resolveModelAttribute(context, coordEnvModel).asString();
    // install JTA environment bean service
    final JTAEnvironmentBeanService jtaEnvironmentBeanService = new JTAEnvironmentBeanService(nodeIdentifier);
    context.getServiceTarget().addService(TxnServices.JBOSS_TXN_JTA_ENVIRONMENT, jtaEnvironmentBeanService).setInitialMode(Mode.ACTIVE).install();
    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.addDependency(CorbaNamingService.SERVICE_NAME);
    }
    transactionManagerServiceServiceBuilder.addDependency(TxnServices.JBOSS_TXN_XA_TERMINATOR, JBossXATerminator.class, transactionManagerService.getXaTerminatorInjector()).addDependency(TxnServices.JBOSS_TXN_USER_TRANSACTION_REGISTRY, UserTransactionRegistry.class, transactionManagerService.getUserTransactionRegistry()).addDependency(TxnServices.JBOSS_TXN_CORE_ENVIRONMENT).addDependency(TxnServices.JBOSS_TXN_ARJUNA_OBJECTSTORE_ENVIRONMENT).addDependency(TxnServices.JBOSS_TXN_ARJUNA_RECOVERY_MANAGER).setInitialMode(ServiceController.Mode.ACTIVE).install();
}
Also used : ArjunaTransactionManagerService(org.jboss.as.txn.service.ArjunaTransactionManagerService) JTAEnvironmentBeanService(org.jboss.as.txn.service.JTAEnvironmentBeanService) UserTransactionRegistry(org.jboss.tm.usertx.UserTransactionRegistry) ArjunaTransactionManagerService(org.jboss.as.txn.service.ArjunaTransactionManagerService) TransactionManagerService(org.jboss.as.txn.service.TransactionManagerService) Endpoint(org.jboss.remoting3.Endpoint)

Aggregations

ArjunaTransactionManagerService (org.jboss.as.txn.service.ArjunaTransactionManagerService)1 JTAEnvironmentBeanService (org.jboss.as.txn.service.JTAEnvironmentBeanService)1 TransactionManagerService (org.jboss.as.txn.service.TransactionManagerService)1 Endpoint (org.jboss.remoting3.Endpoint)1 UserTransactionRegistry (org.jboss.tm.usertx.UserTransactionRegistry)1