Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 1 (11.1.1.7.0)

E10653-08

oracle.adf.model.connection.pool
Class ConnectionPool

java.lang.Object
  extended by oracle.adf.model.connection.pool.ConnectionPool

public class ConnectionPool
extends java.lang.Object

ConnectionPool manages a pool of connections in a system.

When a client does a look up for a connection against the Connection Architecture The Factory that is resposible for creating the connection instances first checks the pool to see if the requested connection already exists. If yes the connection is recycled from the pool

In any case the client is always guarenteed to have a unique instance of the a connection. The instance could be a recycled instance from a pool or a new instance. This is opaque to the client

Since:
10.1.3

Constructor Summary
ConnectionPool()
          Create a ConnectionPool instance of a default size
 
Method Summary
 java.lang.Object allocate(java.lang.Object poolKey)
          Allocate a connection instance from this pool.
protected  void clearCache(java.lang.Object poolKey)
          This is an expensive operation and should be called ONLY when the connection instance is removed from the Context.
 void put(java.lang.Object poolKey, java.lang.Object connection, boolean used)
          Put an Object into the Pool for the first time so that it can be allocated and recycled for subsequent client requests.
 void release(java.lang.Object connection)
          Release a connection back to the pool
protected  void removeBinding(java.lang.Object poolKey, java.lang.Object connection)
          Removes an object from pool, instead of freeing it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionPool

public ConnectionPool()
Create a ConnectionPool instance of a default size

Since:
10.1.3
Method Detail

put

public void put(java.lang.Object poolKey,
                java.lang.Object connection,
                boolean used)
         throws java.lang.Exception
Put an Object into the Pool for the first time so that it can be allocated and recycled for subsequent client requests.

Parameters:
poolKey - The Key associated with the connection instance
connection - The Connection instance to be added to the pool.
Throws:
Exception - If the connection could be added to the pool.
java.lang.Exception

allocate

public java.lang.Object allocate(java.lang.Object poolKey)
                          throws java.lang.Exception
Allocate a connection instance from this pool.

Parameters:
poolKey - The Key associated with the connection to be allocated.
Returns:
The Connection Object requested. A null instance is returned if no connection instance can be found.
Throws:
java.lang.Exception

release

public void release(java.lang.Object connection)
             throws java.lang.Exception
Release a connection back to the pool

Parameters:
connection - The connection instance to be released back to the pool.
Throws:
java.lang.Exception

removeBinding

protected void removeBinding(java.lang.Object poolKey,
                             java.lang.Object connection)
Removes an object from pool, instead of freeing it.

Parameters:
poolKey - the key with which connection was added to pool

clearCache

protected void clearCache(java.lang.Object poolKey)
This is an expensive operation and should be called ONLY when the connection instance is removed from the Context. or a new Instance is added removing the older instance


Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 1 (11.1.1.7.0)

E10653-08

Copyright © 1997, 2013, Oracle. All rights reserved.