1 | public class JOTMTransactionManagerLookup implements TransactionManagerLookup {↵ | | 1 | public class JOnASTransactionManagerLookup implements TransactionManagerLookup {↵
|
|
2 | /**↵ | | 2 | /**↵
|
3 | * {@inheritDoc}↵ | | 3 | * @see org.hibernate.transaction.TransactionManagerLookup#getTransactionManager(Properties)↵
|
4 | */↵ | | 4 | */↵
|
5 | public TransactionManager getTransactionManager(Properties props) throws HibernateException {↵ | | 5 | public TransactionManager getTransactionManager(Properties props) throws HibernateException {↵
|
6 | try {↵ | | 6 | try {↵
|
7 | Class clazz = Class.forName("org.objectweb.jotm.Current");↵ | | 7 | Class clazz = Class.forName("org.objectweb.jonas_tm.Current");↵
|
8 | return (TransactionManager) clazz.getMethod("getTransactionManager", null).invoke(null, null);↵ | | 8 | return (TransactionManager) clazz.getMethod("getTransactionManager", null).invoke(null, null);↵
|
9 | }↵ | | 9 | }↵
|
10 | catch (Exception e) {↵ | | 10 | catch (Exception e) {↵
|
11 | throw new HibernateException( "Could not obtain JOTM transaction manager instance", e );↵ | | 11 | throw new HibernateException( "Could not obtain JOnAS transaction manager instance", e );↵
|
12 | }↵ | | 12 | }↵
|
13 | }↵ | | 13 | }↵
|
|
14 | /**↵ | | 14 | /**↵
|
15 | * {@inheritDoc}↵ | | 15 | * {@inheritDoc}↵
|
16 | */↵ | | 16 | */↵
|
17 | public String getUserTransactionName() {↵ | | 17 | public String getUserTransactionName() {↵
|
18 | return "java:comp/UserTransaction";↵ | | 18 | return "java:comp/UserTransaction";↵
|
19 | }↵ | | 19 | }↵
|
|
20 | /**↵ | | 20 | /**↵
|
21 | * {@inheritDoc}↵ | | 21 | * {@inheritDoc}↵
|
22 | */↵ | | 22 | */↵
|
23 | public Object getTransactionIdentifier(Transaction transaction) {↵ | | 23 | public Object getTransactionIdentifier(Transaction transaction) {↵
|
24 | return transaction;↵ | | 24 | return transaction;↵
|
25 | | | 25 |
|