tyrex.resource.jca
Class ConnectionPool
java.lang.Object
|
+--tyrex.resource.PoolMetrics
|
+--tyrex.resource.jca.ConnectionPool
- All Implemented Interfaces:
- java.util.Collection, javax.resource.spi.ConnectionEventListener, javax.resource.spi.ConnectionManager, java.util.EventListener, Resource, java.lang.Runnable, java.io.Serializable, java.util.Set
- final class ConnectionPool
- extends PoolMetrics
- implements Resource, javax.resource.spi.ConnectionManager, java.util.Set, javax.resource.spi.ConnectionEventListener, java.lang.Runnable
- Version:
- $Revision: 1.9 $
- Author:
- Assaf Arkin
- See Also:
- Serialized Form
Field Summary |
static int |
TABLE_SIZE
The initial table size, unless a maximum number of connections
is specified. |
Methods inherited from class tyrex.resource.PoolMetrics |
getAvailable, getCurrentUnused, getCurrentUsed, getTotal, getTotalCreated, getTotalDiscarded, getTotalErrors, getTotalUsed, getUnusedAvgDuration, getUsedAvgDuration, recordCreated, recordDiscard, recordError, recordUnusedDuration, recordUsedDuration, reset |
Methods inherited from class java.lang.Object |
, clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
TABLE_SIZE
public static final int TABLE_SIZE
- The initial table size, unless a maximum number of connections
is specified.
ConnectionPool
ConnectionPool(java.lang.String name,
PoolLimits limits,
ConnectorLoader loader,
TyrexTransactionManager txManager,
org.apache.log4j.Category category)
throws javax.resource.ResourceException
getPoolMetrics
public PoolMetrics getPoolMetrics()
- Description copied from interface:
Resource
- Returns the pool metrics. The pool metrics object can be used
to collect statistical information about the connection pool.
- Specified by:
getPoolMetrics
in interface Resource
- Following copied from interface:
tyrex.resource.Resource
- Returns:
- The pool metrics
getPoolLimits
public PoolLimits getPoolLimits()
- Description copied from interface:
Resource
- Returns the limits placed on the connection pool. This object
can be used to investigate the limits of the connection pool
and to change them at run time.
- Specified by:
getPoolLimits
in interface Resource
- Following copied from interface:
tyrex.resource.Resource
- Returns:
- The limits placed on the connection pool
getClientFactory
public java.lang.Object getClientFactory()
- Description copied from interface:
Resource
- Returns the client connection factory. The client connection
factory is enlisted in the JNDI environment naming context for
access by the application.
- Specified by:
getClientFactory
in interface Resource
- Following copied from interface:
tyrex.resource.Resource
- Returns:
- The client connection factory
getClientFactoryClass
public java.lang.Class getClientFactoryClass()
- Description copied from interface:
Resource
- Returns the client connection factory class. This the class or
interface that a client connection factory would implement.
- Specified by:
getClientFactoryClass
in interface Resource
- Following copied from interface:
tyrex.resource.Resource
- Returns:
- The client connection factory class
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
getXAResource
public javax.transaction.xa.XAResource getXAResource()
- Description copied from interface:
Resource
- Returns the XA resource interface. The XA resource is used to
manage transaction enlistment and recovery of the resource.
This method returns null if the resource does not support
XA transactions.
- Specified by:
getXAResource
in interface Resource
- Following copied from interface:
tyrex.resource.Resource
- Returns:
- The XA resource interface
destroy
public void destroy()
- Description copied from interface:
Resource
- Called to destory the resource once it is no longer in use.
After successful return from this method, all open connections
are invalidated and no new connections can be obtained from
the pool.
The application server must render the connection factory
inaccessible to the application before calling this method.
- Specified by:
destroy
in interface Resource
run
public void run()
- Specified by:
run
in interface java.lang.Runnable
allocateConnection
public java.lang.Object allocateConnection(javax.resource.spi.ManagedConnectionFactory factory,
javax.resource.spi.ConnectionRequestInfo requestInfo)
throws javax.resource.ResourceException
- Specified by:
allocateConnection
in interface javax.resource.spi.ConnectionManager
connectionClosed
public void connectionClosed(javax.resource.spi.ConnectionEvent event)
- Specified by:
connectionClosed
in interface javax.resource.spi.ConnectionEventListener
connectionErrorOccurred
public void connectionErrorOccurred(javax.resource.spi.ConnectionEvent event)
- Specified by:
connectionErrorOccurred
in interface javax.resource.spi.ConnectionEventListener
localTransactionCommitted
public void localTransactionCommitted(javax.resource.spi.ConnectionEvent event)
- Specified by:
localTransactionCommitted
in interface javax.resource.spi.ConnectionEventListener
localTransactionRolledback
public void localTransactionRolledback(javax.resource.spi.ConnectionEvent event)
- Specified by:
localTransactionRolledback
in interface javax.resource.spi.ConnectionEventListener
localTransactionStarted
public void localTransactionStarted(javax.resource.spi.ConnectionEvent event)
- Specified by:
localTransactionStarted
in interface javax.resource.spi.ConnectionEventListener
expire
protected long expire()
- Called periodically to expire connections that have been
available in the pool for longer than maxRetain seconds.
This method returns the next expiration time, or zero if
no connection is expected to expire soon.
- Returns:
- The next expiration time, or zero if no connection
is expected to expire soon.
add
public boolean add(java.lang.Object object)
- Specified by:
add
in interface java.util.Set
addAll
public boolean addAll(java.util.Collection collection)
- Specified by:
addAll
in interface java.util.Set
clear
public void clear()
- Specified by:
clear
in interface java.util.Set
contains
public boolean contains(java.lang.Object object)
- Specified by:
contains
in interface java.util.Set
containsAll
public boolean containsAll(java.util.Collection collection)
- Specified by:
containsAll
in interface java.util.Set
equals
public boolean equals(java.lang.Object object)
- Specified by:
equals
in interface java.util.Set
- Overrides:
equals
in class java.lang.Object
hashCode
public int hashCode()
- Specified by:
hashCode
in interface java.util.Set
- Overrides:
hashCode
in class java.lang.Object
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interface java.util.Set
iterator
public java.util.Iterator iterator()
- Specified by:
iterator
in interface java.util.Set
remove
public boolean remove(java.lang.Object object)
- Specified by:
remove
in interface java.util.Set
removeAll
public boolean removeAll(java.util.Collection collection)
- Specified by:
removeAll
in interface java.util.Set
retainAll
public boolean retainAll(java.util.Collection collection)
- Specified by:
retainAll
in interface java.util.Set
size
public int size()
- Specified by:
size
in interface java.util.Set
toArray
public java.lang.Object[] toArray()
- Specified by:
toArray
in interface java.util.Set
toArray
public java.lang.Object[] toArray(java.lang.Object[] array)
- Specified by:
toArray
in interface java.util.Set
Intalio Inc. (C) 1999-2001. All rights reserved.