| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private final Condition | |
| private final List | |
| private static final boolean | |
| private static final int | |
| private final PooledConnectionFactory | |
| private boolean | |
| private final int | |
| private final ReentrantLock | |
| private final int | |
| private final int | |
| private Reference | |
| private static final boolean |
| Access | Constructor and Description |
|---|---|
| pack-priv | Connections(Object
the identity (connection request) of the connections in the list id, int the number of connections to create initially initSize, int the preferred size of the pool. The pool will try
to maintain a pool of this size by creating and closing connections
as needed. prefSize, int the maximum size of the pool. The pool will not exceed
this size. If the pool is at this size, a request for a connection
will block until an idle connection is released to the pool or
when one is removed. maxSize, PooledConnectionFactory The factory responsible for creating a connection factory, ReentrantLock lock)
|
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | |
| pack-priv PooledConnection | |
| private void | |
| private void | |
| private void | |
| pack-priv boolean | Returns: true if no more connections in listan entry idle since this time has expired. threshold)Goes through all entries in list, removes and closes ones that have been idle before threshold. |
| pack-priv PooledConnection | getAvailableConnection(long timeout)
Retrieves an idle connection from this list if one is available. |
| pack-priv String | |
| pack-priv boolean | |
| public boolean | releasePooledConnection(PooledConnection conn)
Implements com. Releases connection back into list. |
| public boolean | Returns: true if conn removed; false if it was not in poolpublic because implemented as part of PoolCallback. Implements com. Removes PooledConnection from list of connections. |
| private void | |
| private void | |
| private void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void |
| closed | back to summary |
|---|---|
| private boolean closed | |
| connectionsAvailable | back to summary |
|---|---|
| private final Condition connectionsAvailable | |
| conns | back to summary |
|---|---|
| private final List<ConnectionDesc> conns | |
| debug | back to summary |
|---|---|
| private static final boolean debug | |
| DEFAULT_SIZE | back to summary |
|---|---|
| private static final int DEFAULT_SIZE | |
| factory | back to summary |
|---|---|
| private final PooledConnectionFactory factory | |
| initialized | back to summary |
|---|---|
| private boolean initialized | |
| initSize | back to summary |
|---|---|
| private final int initSize | |
| lock | back to summary |
|---|---|
| private final ReentrantLock lock | |
| maxSize | back to summary |
|---|---|
| private final int maxSize | |
| prefSize | back to summary |
|---|---|
| private final int prefSize | |
| ref | back to summary |
|---|---|
| private Reference<Object> ref | |
| trace | back to summary |
|---|---|
| private static final boolean trace | |
| Connections | back to summary |
|---|---|
pack-priv Connections(Object id, int initSize, int prefSize, int maxSize, PooledConnectionFactory factory, ReentrantLock lock) throws NamingException
| |
| close | back to summary |
|---|---|
| pack-priv void close() Called when this instance of Connections has been removed from Pool. This means that no one can get any pooled connections from this Connections any longer. Expire all idle connections as of 'now' and leave indicator so that any in-use connections will be closed upon their return. | |
| createConnection | back to summary |
|---|---|
| pack-priv PooledConnection createConnection(PooledConnectionFactory factory, long timeout) throws NamingException | |
| d | back to summary |
|---|---|
| private void d(String msg, Object o1) | |
| d | back to summary |
|---|---|
| private void d(String msg, int i) | |
| d | back to summary |
|---|---|
| private void d(String msg) | |
| expire | back to summary |
|---|---|
| pack-priv boolean expire(long threshold) Goes through all entries in list, removes and closes ones that have been idle before threshold.
| |
| getAvailableConnection | back to summary |
|---|---|
| pack-priv PooledConnection getAvailableConnection(long timeout) throws NamingException Retrieves an idle connection from this list if one is available. | |
| getStats | back to summary |
|---|---|
| pack-priv String getStats() | |
| grabLock | back to summary |
|---|---|
| pack-priv boolean grabLock(long timeout) throws InterruptedNamingException | |
| releasePooledConnection | back to summary |
|---|---|
| public boolean releasePooledConnection(PooledConnection conn) Implements com. Releases connection back into list. If the list size is below prefSize, the connection may be reused. If the list size exceeds prefSize, then the connection is closed and removed from the list. public because implemented as part of PoolCallback. | |
| removePooledConnection | back to summary |
|---|---|
| public boolean removePooledConnection(PooledConnection conn) Implements com. Removes PooledConnection from list of connections. The closing of the connection is separate from this method. This method is called usually when the caller encounters an error when using the connection and wants it removed from the pool.
| |
| td | back to summary |
|---|---|
| private void td(String msg, Object o1, Object o2) | |
| td | back to summary |
|---|---|
| private void td(String msg, Object o1) | |
| td | back to summary |
|---|---|
| private void td(String msg) | |
| unlock | back to summary |
|---|---|
| pack-priv void unlock() | |
| waitForAvailableConnection | back to summary |
|---|---|
| pack-priv void waitForAvailableConnection() throws InterruptedNamingException | |
| waitForAvailableConnection | back to summary |
|---|---|
| pack-priv void waitForAvailableConnection(long waitTime) throws InterruptedNamingException | |