|
Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.jbo.pool.ResourcePoolManager oracle.jbo.server.OCIConnectionPoolManagerImpl
Manages a collection of oracle.jdbc.pool.OracleOCIConnectionPool instances.
The OCIConnectionPoolManagerImpl acquires and releases JDBC connections from an OracleOCIConnectionPool. This pool manager should be used if the application requires JDBC/OCI features like middle tier authentication through proxy connections. Proxy authentication may be enabled with the following steps:
1. Grant "connect through" priveleges on the Oracle database to the proxied used. For example, if DB user mary is to use the authenticated credentials of DB user john then the following must be granted to mary:
alter user mary grant connect through john;
2. Specify the proxy properties in the info properties that
are passed to getConnection(String,String,Properties,String,String)
.
Please see the OCI/JDBC application developer's guide for more information
about different proxy types and their required properties.
Proxy properties may be passed from a BC4J client to getConnection
by implementing a EnvInfoProvider
and
declaring it to the framework.
In order to use the OCIConnectionPoolManagerImpl you must first declare it to the framework using a framework property. For example:
jbo.ConnectionPoolManager=oracle.jbo.server.OCIConnectionPoolManagerImpl
Please see ConnectionPoolManager
for more
information about the ConnectionPoolManager interface.
Field Summary |
Fields inherited from class oracle.jbo.pool.ResourcePoolManager |
mLock |
Constructor Summary | |
OCIConnectionPoolManagerImpl()
Constructor |
Method Summary | |
void |
addConnection(java.lang.String poolKey,
java.sql.Connection connection)
Adds a connection to a connection pool. |
protected void |
createPoolMonitor()
|
java.lang.String |
generatePoolKey(java.lang.String url,
java.util.Properties info)
Generates a unique pool identifier (poolKey) for the specified JDBC URL and JDBC driver properties. |
java.lang.String |
generatePoolKey(java.lang.String url,
java.lang.String user,
java.lang.String password)
Generates a unique pool identifier (poolKey) for the specified JDBC URL and JDBC driver properties. |
java.sql.Connection |
getConnection(java.lang.String poolKey,
java.lang.String url,
java.util.Properties info,
java.lang.String user,
java.lang.String password)
Returns a pooled connection from the specified target pool. |
java.sql.Connection |
getConnectionForInternalUse(java.lang.String connectionPoolKey,
java.lang.String url,
java.util.Properties info,
java.lang.String user,
java.lang.String password)
Returns a pooled connection from the specified target pool. |
int |
getInitPoolSize()
Returns the initial pool size for connection pools that are managed by this connection pool manager. |
int |
getMaxPoolSize()
Returns the maximum pool size for connection pools that are managed by this connection pool manager. |
protected int |
getMonitorSleepInterval()
|
void |
removeConnection(java.lang.String poolKey,
java.sql.Connection connection)
Removes a pooled connection from a connection pool. |
void |
returnConnection(java.lang.String poolKey,
java.sql.Connection connection)
Returns a pooled connection to a connection pool. |
void |
returnConnection(java.lang.String poolKey,
java.sql.Connection connection,
java.util.Properties info)
Returns a pooled connection to a connection pool. |
void |
returnConnectionForInternalUse(java.lang.String poolKey,
java.sql.Connection connection,
java.util.Properties info)
Returns a pooled connection to a connection pool. |
Methods inherited from class oracle.jbo.pool.ResourcePoolManager |
addResourcePool, getManagerInstance, getProperty, getResourcePool, getResourcePoolKeys, getResourcePools, getResourcePoolTimer, removePoolMonitor, removeResourcePool |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public OCIConnectionPoolManagerImpl()
Method Detail |
public java.sql.Connection getConnection(java.lang.String poolKey, java.lang.String url, java.util.Properties info, java.lang.String user, java.lang.String password)
ConnectionPoolManager
getConnection
in interface ConnectionPoolManager
poolKey
- a unique identifier for the target connection pool.url
- the JDBC url that will be used to create connections in this pool.info
- the JDBC properties that will be used to create connections
in this pool.user
- the username that will be used for database authentication.password
- the password that will be used for database authentication.ConnectionPoolManager.generatePoolKey(String, Properties)
public java.sql.Connection getConnectionForInternalUse(java.lang.String connectionPoolKey, java.lang.String url, java.util.Properties info, java.lang.String user, java.lang.String password)
ConnectionPoolManager
ConnectionPoolManager.getConnection(String, String, Properties, String, String)
getConnectionForInternalUse
in interface ConnectionPoolManager
connectionPoolKey
- a unique identifier for the target connection
pool.url
- the JDBC url that will be used to create connections in this
pool.info
- the JDBC properties that will be used to create connections
in this pool.user
- the username that will be used for database authentication.password
- the password that will be used for database
authentication.ConnectionPoolManager.generatePoolKey(String, Properties)
public void addConnection(java.lang.String poolKey, java.sql.Connection connection)
ConnectionPoolManager
The implementation of this method should not return the connection to the pool after the connection has been added, because the invoking object still holds a reference to that connection. Instead, it is recommended that returning the new connection be the responsibility of of the object that owns the initial reference to the connection.
addConnection
in interface ConnectionPoolManager
poolKey
- a unique identifier for the target connection pool.connection
- the connection that should be checked in.ConnectionPoolManager.returnConnection(String, Connection)
,
ConnectionPoolManager.generatePoolKey(String, Properties)
public void returnConnection(java.lang.String poolKey, java.sql.Connection connection)
ConnectionPoolManager
The implementation of this operation should ensure that the returned connection does in fact belong to the specified connection pool.
returnConnection
in interface ConnectionPoolManager
poolKey
- a unique identifier for the target connection pool.connection
- the connection that should be checked in.ConnectionPoolManager.generatePoolKey(String, Properties)
public void returnConnection(java.lang.String poolKey, java.sql.Connection connection, java.util.Properties info)
ConnectionPoolManager
The implementation of this operation should ensure that the returned connection does in fact belong to the specified connection pool.
The properties object that is passed to return connection may be used by custom connection pool managers that require the original JDBC context to return the connection to the appropriate pool.
returnConnection
in interface ConnectionPoolManager
poolKey
- a unique identifier for the target connection pool.connection
- the connection that should be checked in.info
- the JDBC context that was used when the connection was
acquired.ConnectionPoolManager.generatePoolKey(String, Properties)
public void returnConnectionForInternalUse(java.lang.String poolKey, java.sql.Connection connection, java.util.Properties info)
ConnectionPoolManager
The implementation of this operation should ensure that the returned connection does in fact belong to the specified connection pool.
The properties object that is passed to return connection may be used by custom connection pool managers that require the original JDBC context to return the connection to the appropriate pool.
This method is invoked when the BC4J framework is releasing a JDBC
connection instance which was used internally. The method is provided for
applications with special handling requirements for internal connections.
Internal connections may be required by BC4J to support the failover and
spill to disk features of the BC4J framework. Most applications may
delegate the implementation of this method to
ConnectionPoolManager.returnConnection(String, Connection, Properties)
.
returnConnectionForInternalUse
in interface ConnectionPoolManager
poolKey
- a unique identifier for the target connection pool.connection
- the connection that should be checked in.info
- the JDBC context that was used when the connection was
acquired.ConnectionPoolManager.generatePoolKey(String, Properties)
public void removeConnection(java.lang.String poolKey, java.sql.Connection connection)
ConnectionPoolManager
removeConnection
in interface ConnectionPoolManager
poolKey
- a unique identifier for the target connection pool.connection
- the connection that should be checked in.ConnectionPoolManager.generatePoolKey(String, Properties)
public java.lang.String generatePoolKey(java.lang.String url, java.util.Properties info)
ConnectionPoolManager
generatePoolKey
in interface ConnectionPoolManager
url
- the JDBC url that will be used to create connections in this
pool.info
- the JDBC properties that will be used to create connections
in this pool.
public java.lang.String generatePoolKey(java.lang.String url, java.lang.String user, java.lang.String password)
ConnectionPoolManager
generatePoolKey
in interface ConnectionPoolManager
url
- the JDBC url that will be used to create connections in this
pool.user
- the user that will be used for database authentication.password
- the password that will be used for database authentication.
public int getInitPoolSize()
ConnectionPoolManager
The InitPoolSize is typically set as a JVM parameter (for example, java -Djbo.initpoolsize=2 myApplication note that lower case for the JVM parameter is required) or in the jboserver.properties file (for example, jbo.InitPoolSize=2 myApplication).
getInitPoolSize
in interface ConnectionPoolManager
public int getMaxPoolSize()
ConnectionPoolManager
The MaxPoolSize is typically set as a JVM parameter (for example, java -Djbo.maxpoolsize=10 myApplication note that lower case for the JVM parameter is required) or in the jboserver.properties file (for example, jbo.MaxPoolSize=10 myApplication).
The maximum number of connections supported by a particular driver should be documented with the driver. The default MaxPoolSize is set high enough so that the driver's maximum number of connections will be reached before the default MaxPoolSize is reached.
getMaxPoolSize
in interface ConnectionPoolManager
protected int getMonitorSleepInterval()
protected void createPoolMonitor()
|
Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2004, Oracle. All rights reserved.