Package bitronix.tm.resource.common
Class XAPool
java.lang.Object
bitronix.tm.resource.common.XAPool
- All Implemented Interfaces:
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
-
Constructor Summary
ConstructorsConstructorDescriptionXAPool(XAResourceProducer xaResourceProducer, ResourceBean bean) XAPool(XAResourceProducer xaResourceProducer, ResourceBean bean, Object[] factoryConstructorArgs) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()findXAResourceHolder(XAResource xaResource) getConnectionHandle(boolean recycle) longbooleanisFailed()voidreset()voidsetFailed(boolean failed) voidshrink()voidstateChanged(XAStatefulHolder source, int oldState, int newState) Fired when the internal state of aXAStatefulHolderhas changed.voidstateChanging(XAStatefulHolder source, int currentState, int futureState) Fired before the internal state of aXAStatefulHolderhas changed.toString()long
-
Constructor Details
-
XAPool
- Throws:
Exception
-
XAPool
public XAPool(XAResourceProducer xaResourceProducer, ResourceBean bean, Object[] factoryConstructorArgs) throws Exception - Throws:
Exception
-
-
Method Details
-
getXAFactory
-
setFailed
public void setFailed(boolean failed) -
isFailed
public boolean isFailed() -
getConnectionHandle
- Throws:
Exception
-
getConnectionHandle
- Throws:
Exception
-
close
public void close() -
totalPoolSize
public long totalPoolSize() -
inPoolSize
public long inPoolSize() -
stateChanged
Description copied from interface:StateChangeListenerFired when the internal state of aXAStatefulHolderhas changed.- Specified by:
stateChangedin interfaceStateChangeListener- Parameters:
source- theXAStatefulHolderchanging state.oldState- the old state of theXAStatefulHolder.newState- the new state of theXAStatefulHolder.
-
stateChanging
Description copied from interface:StateChangeListenerFired before the internal state of aXAStatefulHolderhas changed.- Specified by:
stateChangingin interfaceStateChangeListener- Parameters:
source- theXAStatefulHolderchanging state.currentState- the current state of theXAStatefulHolder.futureState- the future state of theXAStatefulHolder.
-
findXAResourceHolder
-
getNextShrinkDate
-
shrink
- Throws:
Exception
-
reset
- Throws:
Exception
-
toString
-