tyrex.resource.jdbc
Class PoolEntry

java.lang.Object
  extended bytyrex.resource.jdbc.PoolEntry
All Implemented Interfaces:
XAResourceCallback

final class PoolEntry
extends java.lang.Object
implements XAResourceCallback

Represents an entry in the connection pool.

Version:
$Revision: 1.4 $
Author:
Assaf Arkin

Field Summary
protected  int _enlistCount
          The reference count to track the number of times the XA resource is enlisted in a transaction.
protected  boolean _enlistedInTransaction
          True if the XA resource has been enlisted in a transaction
protected  int _hashCode
          The hash code for this entry.
protected  PoolEntry _nextEntry
          Reference to the next connection entry in hash table.
protected  java.lang.String _password
          The password.
protected  javax.sql.PooledConnection _pooled
          The pooled connection associated with this entry.
protected  int _state
          The state of the pooled connection.
protected  long _timeStamp
          The timestamp for a used connection returns the clock time at which the connection was made available to the application.
protected  java.lang.String _user
          The user name.
protected  javax.transaction.xa.XAResource _xaResource
          The XA resource associated with this connection.
 
Constructor Summary
protected PoolEntry(ConnectionPool connectionPool, javax.sql.PooledConnection pooled, int hashCode, javax.transaction.xa.XAResource xaResource, java.lang.String user, java.lang.String password)
          Constructs a new pool entry.
 
Method Summary
 void boundary(javax.transaction.xa.Xid xid, boolean commit)
          Called when the XA resource associated with this callback has been committed/rolledback in a transaction,i.e.
 void enlist(javax.transaction.xa.Xid xid)
          Called when the XA resource associated with this callback has been enlisted in a transaction,i.e.
 void fail(javax.transaction.xa.Xid xid)
          Called when the XA resource associated with this callback has been delisted from a transaction,i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_pooled

protected final javax.sql.PooledConnection _pooled
The pooled connection associated with this entry.


_hashCode

protected final int _hashCode
The hash code for this entry.


_nextEntry

protected PoolEntry _nextEntry
Reference to the next connection entry in hash table.


_state

protected int _state
The state of the pooled connection. One of #AVAILABLE, #IN_USE or #CLOSED.


_xaResource

protected final javax.transaction.xa.XAResource _xaResource
The XA resource associated with this connection. May be null.


_timeStamp

protected long _timeStamp
The timestamp for a used connection returns the clock time at which the connection was made available to the application. The timestamp for an unused connection returns the clock time at which the connection was placed in the pool.


_user

protected final java.lang.String _user
The user name.


_password

protected final java.lang.String _password
The password.


_enlistCount

protected int _enlistCount
The reference count to track the number of times the XA resource is enlisted in a transaction.


_enlistedInTransaction

protected boolean _enlistedInTransaction
True if the XA resource has been enlisted in a transaction

Constructor Detail

PoolEntry

protected PoolEntry(ConnectionPool connectionPool,
                    javax.sql.PooledConnection pooled,
                    int hashCode,
                    javax.transaction.xa.XAResource xaResource,
                    java.lang.String user,
                    java.lang.String password)
Constructs a new pool entry. A new pool entry is not available by default. The available variable must be set to false to make it available.

Parameters:
connectionPool - the connection pool to which this pool entry belongs
pooled - The pooled connection
hashCode - The managed connection hash code
xaResource - The XA resource interface, or null
user - The user name or null
password - The password or null
Method Detail

enlist

public void enlist(javax.transaction.xa.Xid xid)
Called when the XA resource associated with this callback has been enlisted in a transaction,i.e. javax.transaction.XA.XAResource.start(javax.transaction.XA.XAResource.TMSTART) has been called.

Specified by:
enlist in interface XAResourceCallback
Parameters:
xid - the xid that was used to enlist the XA resource (required)

fail

public void fail(javax.transaction.xa.Xid xid)
Called when the XA resource associated with this callback has been delisted from a transaction,i.e. javax.transaction.XA.XAResource.end(javax.transaction.XA.XAResource.TMFAIL) has been called.

Specified by:
fail in interface XAResourceCallback
Parameters:
xid - the xid that was used to enlist the XA resource (required)
See Also:
XAResourceCallback.enlist(javax.transaction.xa.Xid)

boundary

public void boundary(javax.transaction.xa.Xid xid,
                     boolean commit)
Called when the XA resource associated with this callback has been committed/rolledback in a transaction,i.e. javax.transaction.XA.XAResource.commit() or javax.transaction.XA.XAResource.rollback() has been called.

Specified by:
boundary in interface XAResourceCallback
Parameters:
xid - the xid that was used to enlist the XA resource (required)
commit - True if the XA resource has been committed. False if the XA resource has been rolled back.
See Also:
XAResourceCallback.enlist(javax.transaction.xa.Xid)


Original code is Copyright (c) 1999-2001, Intalio, Inc. All Rights Reserved. Contributions by MetaBoss team are Copyright (c) 2003-2005, Softaris Pty. Ltd. All Rights Reserved.