ehcache

net.sf.ehcache.transaction.manager
Class DefaultTransactionManagerLookup

java.lang.Object
  extended by net.sf.ehcache.transaction.manager.DefaultTransactionManagerLookup
All Implemented Interfaces:
TransactionManagerLookup

public class DefaultTransactionManagerLookup
extends java.lang.Object
implements TransactionManagerLookup

Default TransactionManagerLookup implementation, that will be used by an initializing Cache should the user have not specified otherwise.

This implementation will:

  1. try lookup an InitialContext;
  2. if successful, lookup a TransactionManager under java:/TransactionManager, this location can be overriden;
  3. if it failed, or couldn't find javax.transaction.TransactionManager instance, look for a WebSphere TransactionManager;
  4. then, a Bitronix;
  5. and finally an Atomikos one.
To specify under what specific name the TransactionManager is to be found, you can provide a jndiName property using setProperties(java.util.Properties). That can be set in the CacheManager's configuration file. The first TransactionManager instance is then kept and returned on each getTransactionManager() call

Author:
Alex Snaps

Constructor Summary
DefaultTransactionManagerLookup()
           
 
Method Summary
 TransactionManager getTransactionManager()
          Lookup available txnManagers
 void register(EhcacheXAResource resource)
          execute txnManager specific code.
 void setProperties(java.util.Properties properties)
          Setter to the properties properties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultTransactionManagerLookup

public DefaultTransactionManagerLookup()
Method Detail

getTransactionManager

public TransactionManager getTransactionManager()
Lookup available txnManagers

Specified by:
getTransactionManager in interface TransactionManagerLookup
Returns:
TransactionManager

register

public void register(EhcacheXAResource resource)
execute txnManager specific code.

Specified by:
register in interface TransactionManagerLookup

setProperties

public void setProperties(java.util.Properties properties)
Setter to the properties properties. This will be called right after the class has been instantiated.

Specified by:
setProperties in interface TransactionManagerLookup
Parameters:
properties - the properties parsed from the config file's transactionManagerLookup tag's properties attribute

ehcache

true