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);
}
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
}
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);
}
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" }));
}
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);
}
Aggregations