1 /*
2 * $Id:JBossArjunaTransactionManagerFactory.java 8215 2007-09-05 16:56:51Z aperepel $
3 * --------------------------------------------------------------------------------------
4 * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
5 *
6 * The software in this package is published under the terms of the CPAL v1.0
7 * license, a copy of which has been included with this distribution in the
8 * LICENSE.txt file.
9 */
10
11 package org.mule.modules.jboss.transactions;
12
13 import org.mule.MuleManager;
14 import org.mule.umo.manager.UMOTransactionManagerFactory;
15
16 import com.arjuna.ats.arjuna.common.Environment;
17 import com.arjuna.ats.arjuna.common.arjPropertyManager;
18
19 import javax.transaction.TransactionManager;
20
21 public class JBossArjunaTransactionManagerFactory implements UMOTransactionManagerFactory
22 {
23 //static
24 //{
25 //arjPropertyManager.propertyManager.setProperty(LogFactory.LOGGER_PROPERTY, "log4j_releveler");
26 //arjPropertyManager.propertyManager.setProperty(LogFactory.LOGGER_PROPERTY, "jakarta");
27 //arjPropertyManager.propertyManager.setProperty(LogFactory.DEBUG_LEVEL, String.valueOf(DebugLevel.FULL_DEBUGGING));
28 //commonPropertyManager.propertyManager.setProperty(LogFactory.LOGGER_PROPERTY, "jakarta");
29 //commonPropertyManager.propertyManager.setProperty(LogFactory.DEBUG_LEVEL, String.valueOf(DebugLevel.FULL_DEBUGGING));
30 //}
31
32 private TransactionManager tm;
33
34 public JBossArjunaTransactionManagerFactory()
35 {
36 //arjPropertyManager.propertyManager.setProperty("com.arjuna.ats.arjuna.objectstore.objectStoreType", "ShadowNoFileLockStore");
37 //arjPropertyManager.propertyManager.setProperty(Environment.OBJECTSTORE_TYPE, ArjunaNames.Implementation_ObjectStore_JDBCStore().stringForm());
38 final String muleInternalDir = MuleManager.getConfiguration().getWorkingDirectory();
39 arjPropertyManager.propertyManager.setProperty(Environment.OBJECTSTORE_DIR, muleInternalDir + "/transaction-log");
40 }
41
42 public synchronized TransactionManager create() throws Exception
43 {
44 if (tm == null)
45 {
46 tm = com.arjuna.ats.jta.TransactionManager.transactionManager();
47 }
48 return tm;
49 }
50
51 }