/** * Bind the currently configured transaction manager implementation to the JNDI * context passed in. * @param initialContext * @throws javax.naming.NamingException */ public static void bindJTATransactionManagerImplementation(InitialContext initialContext) throws javax.naming.NamingException { /** Look up and instantiate an instance of the configured transaction manager implementation **/ String tmImplementation = jtaPropertyManager.getJTAEnvironmentBean().getJtaTMImplementation(); /** Bind the transaction manager to the appropriate JNDI context **/ Reference ref = new Reference(tmImplementation, tmImplementation, null); initialContext.rebind(getTransactionManagerJNDIName(), ref); }
/** * Retrieve the singleton transaction manager reference. * * @param reset if <code>true</code> then ignore any previous cached implementation * and get a new instance. * @return The singleton transaction manager. Can return null if the instantiation failed. */ public synchronized static javax.transaction.TransactionManager transactionManager (boolean reset) { if ((_transactionManager == null ) || (reset)) { try { _transactionManager = (javax.transaction.TransactionManager) Thread.currentThread().getContextClassLoader().loadClass(jtaPropertyManager.getJTAEnvironmentBean().getJtaTMImplementation()).newInstance(); } catch (Exception e) { if ( jtaLogger.loggerI18N.isErrorEnabled() ) { jtaLogger.loggerI18N.error("com.arjuna.ats.jta.TransactionManager.generalfailure", e); } } } return _transactionManager; }