ehcache

net.sf.ehcache.transaction.manager.btm
Class EhCacheXAResourceProducer

java.lang.Object
  extended by ResourceBean
      extended by net.sf.ehcache.transaction.manager.btm.EhCacheXAResourceProducer

public final class EhCacheXAResourceProducer
extends ResourceBean

EHCache implementation of BTM's XAResourceProducer

Author:
lorban

Method Summary
 void close()
          
 XAStatefulHolder createPooledConnection(java.lang.Object xaFactory, ResourceBean bean)
          
 void endRecovery()
          
 XAResourceHolder findXAResourceHolder(javax.transaction.xa.XAResource xaResource)
          
 javax.naming.Reference getReference()
          
 void init()
          
static void registerXAResource(java.lang.String uniqueName, javax.transaction.xa.XAResource xaResource)
          Register an XAResource of a cache with BTM.
 void setFailed(boolean failed)
          
 XAResourceHolderState startRecovery()
          
static void unregisterXAResource(java.lang.String uniqueName, javax.transaction.xa.XAResource xaResource)
          Unregister an XAResource of a cache from BTM.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

registerXAResource

public static void registerXAResource(java.lang.String uniqueName,
                                      javax.transaction.xa.XAResource xaResource)
Register an XAResource of a cache with BTM. The first time a XAResource is registered a new EhCacheXAResourceProducer is created to hold it.

Parameters:
uniqueName - the uniqueName of this XAResourceProducer, usually the cache's name
xaResource - the XAResource to be registered

unregisterXAResource

public static void unregisterXAResource(java.lang.String uniqueName,
                                        javax.transaction.xa.XAResource xaResource)
Unregister an XAResource of a cache from BTM.

Parameters:
uniqueName - the uniqueName of this XAResourceProducer, usually the cache's name
xaResource - the XAResource to be registered

startRecovery

public XAResourceHolderState startRecovery()
                                    throws RecoveryException

Throws:
RecoveryException

endRecovery

public void endRecovery()
                 throws RecoveryException

Throws:
RecoveryException

setFailed

public void setFailed(boolean failed)


findXAResourceHolder

public XAResourceHolder findXAResourceHolder(javax.transaction.xa.XAResource xaResource)


init

public void init()


close

public void close()


createPooledConnection

public XAStatefulHolder createPooledConnection(java.lang.Object xaFactory,
                                               ResourceBean bean)
                                        throws java.lang.Exception

Throws:
java.lang.Exception

getReference

public javax.naming.Reference getReference()
                                    throws javax.naming.NamingException

Throws:
javax.naming.NamingException

ehcache

true