ehcache

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

java.lang.Object
  extended by bitronix.tm.resource.common.ResourceBean
      extended by net.sf.ehcache.transaction.manager.btm.EhCacheXAResourceProducer
All Implemented Interfaces:
bitronix.tm.resource.common.XAResourceProducer, java.io.Serializable, javax.naming.Referenceable

public final class EhCacheXAResourceProducer
extends bitronix.tm.resource.common.ResourceBean
implements bitronix.tm.resource.common.XAResourceProducer

EHCache implementation of BTM's XAResourceProducer

Author:
lorban
See Also:
Serialized Form

Method Summary
 void close()
          
 bitronix.tm.resource.common.XAStatefulHolder createPooledConnection(java.lang.Object xaFactory, bitronix.tm.resource.common.ResourceBean bean)
          
 void endRecovery()
          
 bitronix.tm.resource.common.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)
          
 bitronix.tm.internal.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 bitronix.tm.resource.common.ResourceBean
getAcquireIncrement, getAcquisitionInterval, getAcquisitionTimeout, getAllowLocalTransactions, getApplyTransactionTimeout, getAutomaticEnlistingEnabled, getClassName, getDeferConnectionRelease, getDriverProperties, getMaxIdleTime, getMaxPoolSize, getMinPoolSize, getTwoPcOrderingPosition, getUniqueName, getUseTmJoin, incCreatedResourcesCounter, setAcquireIncrement, setAcquisitionInterval, setAcquisitionTimeout, setAllowLocalTransactions, setApplyTransactionTimeout, setAutomaticEnlistingEnabled, setClassName, setDeferConnectionRelease, setDriverProperties, setMaxIdleTime, setMaxPoolSize, setMinPoolSize, setTwoPcOrderingPosition, setUniqueName, setUseTmJoin
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface bitronix.tm.resource.common.XAResourceProducer
getUniqueName
 

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 bitronix.tm.internal.XAResourceHolderState startRecovery()
                                                         throws bitronix.tm.recovery.RecoveryException

Specified by:
startRecovery in interface bitronix.tm.resource.common.XAResourceProducer
Throws:
bitronix.tm.recovery.RecoveryException

endRecovery

public void endRecovery()
                 throws bitronix.tm.recovery.RecoveryException

Specified by:
endRecovery in interface bitronix.tm.resource.common.XAResourceProducer
Throws:
bitronix.tm.recovery.RecoveryException

setFailed

public void setFailed(boolean failed)

Specified by:
setFailed in interface bitronix.tm.resource.common.XAResourceProducer

findXAResourceHolder

public bitronix.tm.resource.common.XAResourceHolder findXAResourceHolder(javax.transaction.xa.XAResource xaResource)

Specified by:
findXAResourceHolder in interface bitronix.tm.resource.common.XAResourceProducer

init

public void init()

Specified by:
init in interface bitronix.tm.resource.common.XAResourceProducer

close

public void close()

Specified by:
close in interface bitronix.tm.resource.common.XAResourceProducer

createPooledConnection

public bitronix.tm.resource.common.XAStatefulHolder createPooledConnection(java.lang.Object xaFactory,
                                                                           bitronix.tm.resource.common.ResourceBean bean)
                                                                    throws java.lang.Exception

Specified by:
createPooledConnection in interface bitronix.tm.resource.common.XAResourceProducer
Throws:
java.lang.Exception

getReference

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

Specified by:
getReference in interface javax.naming.Referenceable
Throws:
javax.naming.NamingException

ehcache

true