ehcache

net.sf.ehcache.transaction.manager
Interface TransactionManagerLookup

All Known Implementing Classes:
DefaultTransactionManagerLookup, EhcacheJtaTransactionManagerLookup

public interface TransactionManagerLookup

Interface to enable a XA transactional cache to access the JTA TransactionManager. The implementing class can be configured in your xml file. It will then be instanciated by the Cache, during initialization. It'll then have the properties injected, should any have been specified. And finally, the TransactionManager will be queried for using #getTransactionManager.

Author:
Alex Snaps

Method Summary
 TransactionManager getTransactionManager()
          Lookup available txnManagers
 void init()
          Switch the TransactionManagerLookup implementation to its initialized state.
 void register(EhcacheXAResource resource, boolean forRecovery)
          execute txnManager specific code to register the XAResource for recovery.
 void setProperties(Properties properties)
          Setter to the properties properties.
 void unregister(EhcacheXAResource resource, boolean forRecovery)
          execute txnManager specific code to unregister the XAResource for recovery.
 

Method Detail

init

void init()
Switch the TransactionManagerLookup implementation to its initialized state. All EhcacheXAResources registered before initialization are queued up internally and are only registered with the transaction manager during initialization.


getTransactionManager

TransactionManager getTransactionManager()
Lookup available txnManagers

Returns:
TransactionManager

register

void register(EhcacheXAResource resource,
              boolean forRecovery)
execute txnManager specific code to register the XAResource for recovery.

Parameters:
resource - the XAResource to register for recovery in the choosen TM.
forRecovery - true if the XAResource is meant to be registered for recovery purpose only.

unregister

void unregister(EhcacheXAResource resource,
                boolean forRecovery)
execute txnManager specific code to unregister the XAResource for recovery.

Parameters:
resource - the XAResource to register for recovery in the choosen TM.
forRecovery - true if the XAResource is meant to be registered for recovery purpose only.

setProperties

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

Parameters:
properties - the properties parsed from the config file's transactionManagerLookup tag's properties attribute

ehcache

Copyright 2001-2017, Terracotta, Inc.