|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbitronix.tm.resource.common.AbstractXAStatefulHolder
bitronix.tm.resource.common.AbstractXAResourceHolder
bitronix.tm.resource.jdbc.JdbcPooledConnection
public class JdbcPooledConnection
Implementation of a JDBC pooled connection wrapping vendor's XAConnection
implementation.
Field Summary |
---|
Fields inherited from interface bitronix.tm.resource.common.XAStatefulHolder |
---|
STATE_ACCESSIBLE, STATE_CLOSED, STATE_IN_POOL, STATE_NOT_ACCESSIBLE |
Constructor Summary | |
---|---|
JdbcPooledConnection(PoolingDataSource poolingDataSource,
XAConnection xaConnection)
|
Method Summary | |
---|---|
void |
close()
Close the physical connection that this XAStatefulHolder represents. |
RecoveryXAResourceHolder |
createRecoveryXAResourceHolder()
|
Date |
getAcquisitionDate()
|
protected JdbcPreparedStatementHandle |
getCachedStatement(JdbcPreparedStatementHandle stmt)
Get a PreparedStatement from cache. |
Object |
getConnectionHandle()
Create a disposable handler used to drive a pooled instance of XAStatefulHolder . |
Date |
getLastReleaseDate()
Get the date at which this object was last released to the pool. |
PoolingDataSource |
getPoolingDataSource()
|
ResourceBean |
getResourceBean()
Get the ResourceBean which created this XAResourceHolder. |
String |
getStateDescription()
|
Collection |
getTransactionGtridsCurrentlyHoldingThis()
|
XAResource |
getXAResource()
Get the vendor's XAResource implementation of the wrapped resource. |
List<XAResourceHolder> |
getXAResourceHolders()
Get the list of XAResourceHolder s created by this
XAStatefulHolder that are still open. |
protected JdbcPreparedStatementHandle |
putCachedStatement(JdbcPreparedStatementHandle stmt)
Put a PreparedStatement in the cache. |
protected Statement |
registerUncachedStatement(Statement stmt)
Register uncached statement so that it can be closed when the connection is put back in the pool. |
protected void |
release()
|
void |
stateChanged(XAStatefulHolder source,
int oldState,
int newState)
Fired when the internal state of a XAStatefulHolder has changed. |
void |
stateChanging(XAStatefulHolder source,
int currentState,
int futureState)
Fired before the internal state of a XAStatefulHolder has changed. |
String |
toString()
|
protected void |
unregisterUncachedStatement(Statement stmt)
|
Methods inherited from class bitronix.tm.resource.common.AbstractXAResourceHolder |
---|
getXAResourceHolderStateGtrids, getXAResourceHolderStatesForGtrid, hasStateForXAResource, isParticipatingInActiveGlobalTransaction, putXAResourceHolderState, removeXAResourceHolderState |
Methods inherited from class bitronix.tm.resource.common.AbstractXAStatefulHolder |
---|
addStateChangeEventListener, getState, removeStateChangeEventListener, setState |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface bitronix.tm.resource.common.XAStatefulHolder |
---|
addStateChangeEventListener, getState, removeStateChangeEventListener, setState |
Constructor Detail |
---|
public JdbcPooledConnection(PoolingDataSource poolingDataSource, XAConnection xaConnection) throws SQLException
SQLException
Method Detail |
---|
public void close() throws SQLException
XAStatefulHolder
XAStatefulHolder
represents.
close
in interface XAStatefulHolder
SQLException
public RecoveryXAResourceHolder createRecoveryXAResourceHolder()
protected void release() throws SQLException
SQLException
public XAResource getXAResource()
XAResourceHolder
XAResource
implementation of the wrapped resource.
getXAResource
in interface XAResourceHolder
public ResourceBean getResourceBean()
XAResourceHolder
getResourceBean
in interface XAResourceHolder
public PoolingDataSource getPoolingDataSource()
public List<XAResourceHolder> getXAResourceHolders()
XAStatefulHolder
XAResourceHolder
s created by this
XAStatefulHolder
that are still open.
This method is thread-safe.
getXAResourceHolders
in interface XAStatefulHolder
XAResourceHolder
s created by this
XAStatefulHolder
that are still open.public Object getConnectionHandle() throws Exception
XAStatefulHolder
XAStatefulHolder
.
This method is thread-safe.
getConnectionHandle
in interface XAStatefulHolder
Exception
- a resource-specific exception thrown when the disaposable connection cannot be created.public void stateChanged(XAStatefulHolder source, int oldState, int newState)
StateChangeListener
XAStatefulHolder
has changed.
stateChanged
in interface StateChangeListener
source
- the XAStatefulHolder
changing state.oldState
- the old state of the XAStatefulHolder
.newState
- the new state of the XAStatefulHolder
.public void stateChanging(XAStatefulHolder source, int currentState, int futureState)
StateChangeListener
XAStatefulHolder
has changed.
stateChanging
in interface StateChangeListener
source
- the XAStatefulHolder
changing state.currentState
- the current state of the XAStatefulHolder
.futureState
- the future state of the XAStatefulHolder
.protected JdbcPreparedStatementHandle getCachedStatement(JdbcPreparedStatementHandle stmt)
stmt
- the key that has been used to cache the statement.
protected JdbcPreparedStatementHandle putCachedStatement(JdbcPreparedStatementHandle stmt)
stmt
- the statement to cache.
protected Statement registerUncachedStatement(Statement stmt)
stmt
- the statement to register.
protected void unregisterUncachedStatement(Statement stmt)
public String toString()
toString
in class Object
public String getStateDescription()
getStateDescription
in interface JdbcPooledConnectionMBean
public Date getAcquisitionDate()
getAcquisitionDate
in interface JdbcPooledConnectionMBean
public Date getLastReleaseDate()
XAStatefulHolder
getLastReleaseDate
in interface XAStatefulHolder
public Collection getTransactionGtridsCurrentlyHoldingThis()
getTransactionGtridsCurrentlyHoldingThis
in interface JdbcPooledConnectionMBean
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |