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:
    UniversalConnectionPool, ConnectionRetrievalInfo
    • Method Detail

      • createConnectionAsync

        default java.util.concurrent.CompletionStage<java.lang.Object> createConnectionAsync​(ConnectionRetrievalInfo cri,
                                                                                             java.util.concurrent.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 java.util.concurrent.CompletionStage<java.lang.Void> closeConnectionAsync​(java.lang.Object connection,
                                                                                          java.util.concurrent.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​(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 UniversalPooledConnection object.
        Throws:
        UniversalConnectionPoolException - if an error occurs while creating the UniversalPooledConnection object.