Package oracle.ucp

Interface ConnectionFactoryAdapter

All Superinterfaces:
Diagnosable

public interface ConnectionFactoryAdapter extends Diagnosable
The 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:
  • Method Details

    • createConnection

      Object createConnection(ConnectionRetrievalInfo connectionRequestInfo) throws UniversalConnectionPoolException
      Creates a connection.
      Parameters:
      connectionRequestInfo - The information to use to create the connection.
      Returns:
      A connection. null if a connection could not be created.
      Throws:
      UniversalConnectionPoolException - if an error occurs while creating the connection.
    • closeConnection

      void closeConnection(Object connection) throws UniversalConnectionPoolException
      Closes the given connection.
      Parameters:
      connection - The connection to close.
      Throws:
      UniversalConnectionPoolException - if an error occurs while closing the connection.
    • createConnectionAsync

      default CompletionStage<Object> createConnectionAsync(ConnectionRetrievalInfo cri, Executor executor)
      Creates a connection asynchronously.
      Parameters:
      cri - The information to use to create the connection.
      executor - executor for asynchronous operation
      Returns:
      completion stage for created connection (can return null or thrown exception)
    • closeConnectionAsync

      default CompletionStage<Void> closeConnectionAsync(Object connection, Executor executor)
      Closes a connection asynchronously.
      Parameters:
      connection - Connection to close.
      executor - executor for asynchronous operation
      Returns:
      completion stage for joining (or getting) an end of closure.
    • createPooledConnection

      UniversalPooledConnection createPooledConnection(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 UniversalPooledConnection object.
      Throws:
      UniversalConnectionPoolException - if an error occurs while creating the UniversalPooledConnection object.
    • 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 be null.
      Throws:
      UniversalConnectionPoolException - if the connection pool is null.
    • getLoginTimeout

      default long getLoginTimeout()
      get login timeout for this CFA.
      Returns:
      login timeout (in milliseconds) for applicable connection factory adapters, or 0L.