org.apache.ojb.broker.transaction.tm
Class AbstractTransactionManagerFactory

java.lang.Object
  extended by org.apache.ojb.broker.transaction.tm.AbstractTransactionManagerFactory
All Implemented Interfaces:
TransactionManagerFactory
Direct Known Subclasses:
JBossTransactionManagerFactory, JOnASTransactionManagerFactory, OrionTransactionManagerFactory, SunOneTransactionManagerFactory, WeblogicTransactionManagerFactory, WebSphereTransactionManagerFactory

public abstract class AbstractTransactionManagerFactory
extends Object
implements TransactionManagerFactory

Abstract base class implementation of the TransactionManagerFactory interface, all derived classes have to implement method getLookupInfo().

Version:
$Id: AbstractTransactionManagerFactory.java,v 1.1 2007-08-24 22:17:41 ewestfal Exp $
Author:
Armin Waibel

Field Summary
private static Logger log
           
private static TransactionManager tm
           
static String TM_DEFAULT_METHOD_NAME
          Returns "getTransactionManager";
 
Constructor Summary
AbstractTransactionManagerFactory()
           
 
Method Summary
abstract  String[][] getLookupInfo()
          Returns an array of possible JNDI lookup / class names for the TransactionManager instance.
 TransactionManager getTransactionManager()
           
protected  TransactionManager instantiateClass(String description, String className, String methodName)
           
protected  TransactionManager jndiLookup(String description, String methodName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static Logger log

TM_DEFAULT_METHOD_NAME

public static String TM_DEFAULT_METHOD_NAME
Returns "getTransactionManager";


tm

private static TransactionManager tm
Constructor Detail

AbstractTransactionManagerFactory

public AbstractTransactionManagerFactory()
Method Detail

getLookupInfo

public abstract String[][] getLookupInfo()
Returns an array of possible JNDI lookup / class names for the TransactionManager instance. An array was used because for different application server versions the JNDI/class name may change.

Expect an [n][3] string array. Following arguments are available:

Example:

{{"JBoss", "java:/TransactionManager", null}};
In JBoss we lookup the TM via JNDI, so we don't need a TM factory class.

{{"Websphere 4", TM_DEFAULT_METHOD_NAME, "com.ibm.ejs.jts.jta.JTSXA"},
{"Websphere 5", TM_DEFAULT_METHOD_NAME, "com.ibm.ejs.jts.jta.TransactionManagerFactory"},
{"Websphere >5", TM_DEFAULT_METHOD_NAME, "com.ibm.ws.Transaction.TransactionManagerFactory"}};
In Websphere we have to use a TM factory class and obtain the TM via a getTransactionManager() method call. The TM factory class is varied in different versions.


getTransactionManager

public TransactionManager getTransactionManager()
                                         throws TransactionManagerFactoryException
Specified by:
getTransactionManager in interface TransactionManagerFactory
Throws:
TransactionManagerFactoryException
See Also:
TransactionManagerFactory

jndiLookup

protected TransactionManager jndiLookup(String description,
                                        String methodName)

instantiateClass

protected TransactionManager instantiateClass(String description,
                                              String className,
                                              String methodName)
                                       throws Exception
Throws:
Exception


Copyright © 2007-2012 The Kuali Foundation. All Rights Reserved.