if (testMixIn instanceof TransactionMixInParticipant) {
try {
_logger.debug("Trying to locate JTA environment using " + testMixIn);
_jtaEnvironmentBean = ((TransactionMixInParticipant) testMixIn).locateEnvironmentBean();
} catch (Throwable e) {
throw new SwitchYardException("Exception during locating arjuna environment bean", e);
}
}
}
}
try {
if (_jtaEnvironmentBean == null) {
System.setProperty("ObjectStoreEnvironmentBean.objectStoreDir", _storeDir);
System.setProperty("com.arjuna.ats.arjuna.objectstore.objectStoreDir", _storeDir);
_jtaEnvironmentBean = jtaPropertyManager.getJTAEnvironmentBean();
_jtaEnvironmentBean.setTransactionManagerClassName(com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionManagerImple.class.getName());
_jtaEnvironmentBean.setUserTransactionClassName(com.arjuna.ats.internal.jta.transaction.arjunacore.UserTransactionImple.class.getName());
_jtaEnvironmentBean.setTransactionSynchronizationRegistryClassName(com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionSynchronizationRegistryImple.class.getName());
InitialContext initialContext = new InitialContext();
initialContext.bind("java:jboss/TransactionManager", _jtaEnvironmentBean.getTransactionManager());
initialContext.bind("java:jboss/UserTransaction", _jtaEnvironmentBean.getUserTransaction());
initialContext.bind("java:jboss/TransactionSynchronizationRegistry", _jtaEnvironmentBean.getTransactionSynchronizationRegistry());
}
} catch (NamingException e) {
throw new SwitchYardException("Unable to bind transaction manager in JNDI", e);
}
}