Package oracle.ucp
Interface ConnectionFactoryAdapter
-
public interface ConnectionFactoryAdapterThe connection factory adapter is responsible for creating and closing connections for a specific resource (such as, JDBC or JCA). When a connection is created, the connection factory adapter uses the information in the connection retrieval info object to create a connection. For example, if the resource is JDBC, the connection retrieval info object contains a user and password that the connection factory adapter uses to ask the JDBC resource for a connection.- See Also:
UniversalConnectionPool,ConnectionRetrievalInfo
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcloseConnection(java.lang.Object connection)Closes the given connection.java.lang.ObjectcreateConnection(ConnectionRetrievalInfo connectionRequestInfo)Creates a connection.UniversalPooledConnectioncreatePooledConnection(java.lang.Object connection, ConnectionRetrievalInfo connectionRequestInfo)Creates a UniversalPooledConnection object.voidsetUniversalConnectionPool(UniversalConnectionPool connectionPool)Sets the connection pool that interacts with this connection factory adapter.
-
-
-
Method Detail
-
createConnection
java.lang.Object createConnection(ConnectionRetrievalInfo connectionRequestInfo) throws UniversalConnectionPoolException
Creates a connection.- Parameters:
connectionRequestInfo- The information to use to create the connection.- Returns:
- A connection.
nullif a connection could not be created. - Throws:
UniversalConnectionPoolException- if an error occurs while creating the connection.
-
closeConnection
void closeConnection(java.lang.Object connection) throws UniversalConnectionPoolExceptionCloses the given connection.- Parameters:
connection- The connection to close.- Throws:
UniversalConnectionPoolException- if an error occurs while closing the connection.
-
createPooledConnection
UniversalPooledConnection createPooledConnection(java.lang.Object connection, ConnectionRetrievalInfo connectionRequestInfo) throws UniversalConnectionPoolException
Creates a UniversalPooledConnection object.- Parameters:
connection- The physical connection that this pooled connection decorates.connectionRequestInfo- The connection retrieval info object used to create the decorated connection.- Returns:
- The
created UniversalPooledConnectionobject. - Throws:
UniversalConnectionPoolException- if an error occurs while creating theUniversalPooledConnectionobject.
-
setUniversalConnectionPool
void setUniversalConnectionPool(UniversalConnectionPool connectionPool) throws UniversalConnectionPoolException
Sets the connection pool that interacts with this connection factory adapter.- Parameters:
connectionPool- The connection pool that interacts with this connection factory adapter. Cannot benull.- Throws:
UniversalConnectionPoolException- if the connection pool isnull.
-
-