bitronix.tm.resource.common
Class XAPool
java.lang.Object
bitronix.tm.resource.common.XAPool
- All Implemented Interfaces:
- StateChangeListener
public class XAPool
- extends Object
- implements StateChangeListener
Generic XA pool. XAStatefulHolder
instances are created by the XAPool
out of a
XAResourceProducer
. Those objects are then pooled and can be retrieved and/or recycled by the pool
depending on the running XA transaction's and the XAStatefulHolder
's states.
- Author:
- lorban
XAPool
public XAPool(XAResourceProducer xaResourceProducer,
ResourceBean bean)
throws Exception
- Throws:
Exception
getXAFactory
public Object getXAFactory()
setFailed
public void setFailed(boolean failed)
isFailed
public boolean isFailed()
getConnectionHandle
public Object getConnectionHandle()
throws Exception
- Throws:
Exception
getConnectionHandle
public Object getConnectionHandle(boolean recycle)
throws Exception
- Throws:
Exception
close
public void close()
totalPoolSize
public long totalPoolSize()
inPoolSize
public long inPoolSize()
stateChanged
public void stateChanged(XAStatefulHolder source,
int oldState,
int newState)
- Description copied from interface:
StateChangeListener
- Fired when the internal state of a
XAStatefulHolder
has changed.
- Specified by:
stateChanged
in interface StateChangeListener
- Parameters:
source
- the XAStatefulHolder
changing state.oldState
- the old state of the XAStatefulHolder
.newState
- the new state of the XAStatefulHolder
.
stateChanging
public void stateChanging(XAStatefulHolder source,
int currentState,
int futureState)
- Description copied from interface:
StateChangeListener
- Fired before the internal state of a
XAStatefulHolder
has changed.
- Specified by:
stateChanging
in interface StateChangeListener
- Parameters:
source
- the XAStatefulHolder
changing state.currentState
- the current state of the XAStatefulHolder
.futureState
- the future state of the XAStatefulHolder
.
findXAResourceHolder
public XAResourceHolder findXAResourceHolder(XAResource xaResource)
getNextShrinkDate
public Date getNextShrinkDate()
shrink
public void shrink()
throws Exception
- Throws:
Exception
reset
public void reset()
throws Exception
- Throws:
Exception
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2006-2013 Bitronix Software. All Rights Reserved.