Search in sources :

Example 1 with JTAEnvironmentBean

use of com.arjuna.ats.jta.common.JTAEnvironmentBean in project wildfly by wildfly.

the class JTAEnvironmentBeanService method stop.

@Override
public void stop(StopContext context) {
    final JTAEnvironmentBean jtaEnvironmentBean = jtaPropertyManager.getJTAEnvironmentBean();
    // reset the XA orphan filters
    jtaEnvironmentBean.setXaResourceOrphanFilterClassNames(null);
    // reset the recovery nodes
    jtaEnvironmentBean.setXaRecoveryNodes(null);
    // reset the record wrapper plugin
    jtaEnvironmentBean.setXAResourceRecordWrappingPlugin(null);
    jtaEnvironmentBean.setLastResourceOptimisationInterfaceClassName(null);
}
Also used : JTAEnvironmentBean(com.arjuna.ats.jta.common.JTAEnvironmentBean)

Example 2 with JTAEnvironmentBean

use of com.arjuna.ats.jta.common.JTAEnvironmentBean in project wildfly by wildfly.

the class EJBClientXidTransactionTestCase method beforeTestClass.

/**
     * Create and setup the remoting connection
     *
     * @throws Exception
     */
@BeforeClass
public static void beforeTestClass() throws Exception {
    // These system properties are required or else we end up picking up JTS transaction manager,
    // which is not what we want
    final JTAEnvironmentBean jtaEnvironmentBean = jtaPropertyManager.getJTAEnvironmentBean();
    jtaEnvironmentBean.setTransactionManagerClassName(TransactionManagerImple.class.getName());
    jtaEnvironmentBean.setTransactionSynchronizationRegistryClassName(TransactionSynchronizationRegistryImple.class.getName());
    final TransactionManager narayanaTm = jtaEnvironmentBean.getTransactionManager();
    final TransactionSynchronizationRegistry narayanaTsr = jtaEnvironmentBean.getTransactionSynchronizationRegistry();
    final XATerminator xat = new XATerminator();
    final JBossLocalTransactionProvider.Builder builder = JBossLocalTransactionProvider.builder();
    builder.setXATerminator(xat).setExtendedJBossXATerminator(xat);
    builder.setTransactionManager(narayanaTm);
    builder.setTransactionSynchronizationRegistry(narayanaTsr);
    LocalTransactionContext.getContextManager().setGlobalDefault(new LocalTransactionContext(builder.build()));
    txManager = ContextTransactionManager.getInstance();
    txSyncRegistry = ContextTransactionSynchronizationRegistry.getInstance();
// setup the tx manager and tx sync registry
}
Also used : XATerminator(com.arjuna.ats.internal.jbossatx.jta.jca.XATerminator) TransactionManagerImple(com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionManagerImple) TransactionSynchronizationRegistryImple(com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionSynchronizationRegistryImple) JBossLocalTransactionProvider(org.wildfly.transaction.client.provider.jboss.JBossLocalTransactionProvider) ContextTransactionManager(org.wildfly.transaction.client.ContextTransactionManager) TransactionManager(javax.transaction.TransactionManager) TransactionSynchronizationRegistry(javax.transaction.TransactionSynchronizationRegistry) ContextTransactionSynchronizationRegistry(org.wildfly.transaction.client.ContextTransactionSynchronizationRegistry) JTAEnvironmentBean(com.arjuna.ats.jta.common.JTAEnvironmentBean) LocalTransactionContext(org.wildfly.transaction.client.LocalTransactionContext) BeforeClass(org.junit.BeforeClass)

Example 3 with JTAEnvironmentBean

use of com.arjuna.ats.jta.common.JTAEnvironmentBean in project wildfly by wildfly.

the class HTTPEJBClientXidTransactionTestCase method beforeTestClass.

/**
     * Create and setup the remoting connection
     *
     * @throws Exception
     */
@BeforeClass
public static void beforeTestClass() throws Exception {
    // These system properties are required or else we end up picking up JTS transaction manager,
    // which is not what we want
    final JTAEnvironmentBean jtaEnvironmentBean = jtaPropertyManager.getJTAEnvironmentBean();
    jtaEnvironmentBean.setTransactionManagerClassName(TransactionManagerImple.class.getName());
    jtaEnvironmentBean.setTransactionSynchronizationRegistryClassName(TransactionSynchronizationRegistryImple.class.getName());
    final TransactionManager narayanaTm = jtaEnvironmentBean.getTransactionManager();
    final TransactionSynchronizationRegistry narayanaTsr = jtaEnvironmentBean.getTransactionSynchronizationRegistry();
    final XATerminator xat = new XATerminator();
    final JBossLocalTransactionProvider.Builder builder = JBossLocalTransactionProvider.builder();
    builder.setXATerminator(xat).setExtendedJBossXATerminator(xat);
    builder.setTransactionManager(narayanaTm);
    builder.setTransactionSynchronizationRegistry(narayanaTsr);
    LocalTransactionContext.getContextManager().setGlobalDefault(new LocalTransactionContext(builder.build()));
    txManager = ContextTransactionManager.getInstance();
    txSyncRegistry = ContextTransactionSynchronizationRegistry.getInstance();
    // setup the tx manager and tx sync registry
    AuthenticationConfiguration config = AuthenticationConfiguration.EMPTY.useName("user1").usePassword("password1");
    AuthenticationContext context = AuthenticationContext.empty().with(MatchRule.ALL, config);
    old = AuthenticationContext.captureCurrent();
    AuthenticationContext.getContextManager().setGlobalDefault(context);
}
Also used : AuthenticationConfiguration(org.wildfly.security.auth.client.AuthenticationConfiguration) XATerminator(com.arjuna.ats.internal.jbossatx.jta.jca.XATerminator) TransactionManagerImple(com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionManagerImple) TransactionSynchronizationRegistryImple(com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionSynchronizationRegistryImple) JBossLocalTransactionProvider(org.wildfly.transaction.client.provider.jboss.JBossLocalTransactionProvider) AuthenticationContext(org.wildfly.security.auth.client.AuthenticationContext) ContextTransactionManager(org.wildfly.transaction.client.ContextTransactionManager) TransactionManager(javax.transaction.TransactionManager) TransactionSynchronizationRegistry(javax.transaction.TransactionSynchronizationRegistry) ContextTransactionSynchronizationRegistry(org.wildfly.transaction.client.ContextTransactionSynchronizationRegistry) JTAEnvironmentBean(com.arjuna.ats.jta.common.JTAEnvironmentBean) LocalTransactionContext(org.wildfly.transaction.client.LocalTransactionContext) BeforeClass(org.junit.BeforeClass)

Example 4 with JTAEnvironmentBean

use of com.arjuna.ats.jta.common.JTAEnvironmentBean in project narayana by jbosstm.

the class CrashRecovery2 method setUp.

@Before
public void setUp() {
    RecoveryEnvironmentBean recoveryEnvironmentBean = recoveryPropertyManager.getRecoveryEnvironmentBean();
    recoveryEnvironmentBean.setRecoveryModuleClassNames(Arrays.asList(new String[] { "com.arjuna.ats.internal.arjuna.recovery.AtomicActionRecoveryModule", "com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule" }));
    JTAEnvironmentBean jtaEnvironmentBean = jtaPropertyManager.getJTAEnvironmentBean();
    jtaEnvironmentBean.setXaResourceRecoveryClassNames(Arrays.asList(new String[] { "com.hp.mwtests.ts.jta.recovery.TestXAResourceRecovery" }));
    jtaEnvironmentBean.setXaResourceOrphanFilterClassNames(Arrays.asList(new String[] { "com.arjuna.ats.internal.jta.recovery.arjunacore.JTATransactionLogXAResourceOrphanFilter", "com.arjuna.ats.internal.jta.recovery.arjunacore.JTANodeNameXAResourceOrphanFilter" }));
    jtaEnvironmentBean.setXaRecoveryNodes(Arrays.asList(new String[] { "1" }));
}
Also used : RecoveryEnvironmentBean(com.arjuna.ats.arjuna.common.RecoveryEnvironmentBean) JTAEnvironmentBean(com.arjuna.ats.jta.common.JTAEnvironmentBean) Before(org.junit.Before)

Example 5 with JTAEnvironmentBean

use of com.arjuna.ats.jta.common.JTAEnvironmentBean in project narayana by jbosstm.

the class SPIUnitTest method initJTS.

public static void initJTS() throws Exception {
    initORB();
    JTAEnvironmentBean jtaEnvironmentBean = jtaPropertyManager.getJTAEnvironmentBean();
    jtaEnvironmentBean.setTransactionManagerClassName(com.arjuna.ats.jbossatx.jts.TransactionManagerDelegate.class.getName());
    JNDIManager.bindJTATransactionManagerImplementation(initialContext);
    jtaEnvironmentBean.setTransactionSynchronizationRegistryClassName(com.arjuna.ats.internal.jta.transaction.jts.TransactionSynchronizationRegistryImple.class.getName());
    JNDIManager.bindJTATransactionSynchronizationRegistryImplementation(initialContext);
    final com.arjuna.ats.jbossatx.jts.TransactionManagerService service = new com.arjuna.ats.jbossatx.jts.TransactionManagerService();
    final ServerVMClientUserTransaction userTransaction = new ServerVMClientUserTransaction(service.getTransactionManager());
    jtaEnvironmentBean.setUserTransaction(userTransaction);
    JNDIManager.bindJTAUserTransactionImplementation(initialContext);
    UserTransactionRegistry userTransactionRegistry = new UserTransactionRegistry();
    userTransactionRegistry.addProvider(userTransaction);
}
Also used : ServerVMClientUserTransaction(org.jboss.tm.usertx.client.ServerVMClientUserTransaction) JTAEnvironmentBean(com.arjuna.ats.jta.common.JTAEnvironmentBean) UserTransactionRegistry(org.jboss.tm.usertx.UserTransactionRegistry) javax.transaction(javax.transaction)

Aggregations

JTAEnvironmentBean (com.arjuna.ats.jta.common.JTAEnvironmentBean)8 RecoveryEnvironmentBean (com.arjuna.ats.arjuna.common.RecoveryEnvironmentBean)2 XATerminator (com.arjuna.ats.internal.jbossatx.jta.jca.XATerminator)2 TransactionManagerImple (com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionManagerImple)2 TransactionSynchronizationRegistryImple (com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionSynchronizationRegistryImple)2 RecoveryManagerService (com.arjuna.ats.jbossatx.jta.RecoveryManagerService)2 TransactionManagerService (com.arjuna.ats.jbossatx.jta.TransactionManagerService)2 TransactionManager (javax.transaction.TransactionManager)2 TransactionSynchronizationRegistry (javax.transaction.TransactionSynchronizationRegistry)2 BeforeClass (org.junit.BeforeClass)2 ContextTransactionManager (org.wildfly.transaction.client.ContextTransactionManager)2 ContextTransactionSynchronizationRegistry (org.wildfly.transaction.client.ContextTransactionSynchronizationRegistry)2 LocalTransactionContext (org.wildfly.transaction.client.LocalTransactionContext)2 JBossLocalTransactionProvider (org.wildfly.transaction.client.provider.jboss.JBossLocalTransactionProvider)2 CoordinatorEnvironmentBean (com.arjuna.ats.arjuna.common.CoordinatorEnvironmentBean)1 CoreEnvironmentBean (com.arjuna.ats.arjuna.common.CoreEnvironmentBean)1 ObjectStoreEnvironmentBean (com.arjuna.ats.arjuna.common.ObjectStoreEnvironmentBean)1 TxControl (com.arjuna.ats.arjuna.coordinator.TxControl)1 ObjStoreBrowser (com.arjuna.ats.arjuna.tools.osb.mbean.ObjStoreBrowser)1 ManualProcessId (com.arjuna.ats.internal.arjuna.utils.ManualProcessId)1