Class CPoolProxy

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, ManagedHttpClientConnection, org.apache.http.HttpClientConnection, org.apache.http.HttpConnection, org.apache.http.HttpInetConnection, org.apache.http.protocol.HttpContext

    class CPoolProxy
    extends java.lang.Object
    implements ManagedHttpClientConnection, org.apache.http.protocol.HttpContext
    Since:
    4.3
    • Field Detail

      • poolEntry

        private volatile CPoolEntry poolEntry
    • Constructor Detail

    • Method Detail

      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface org.apache.http.HttpConnection
        Throws:
        java.io.IOException
      • shutdown

        public void shutdown()
                      throws java.io.IOException
        Specified by:
        shutdown in interface org.apache.http.HttpConnection
        Throws:
        java.io.IOException
      • isOpen

        public boolean isOpen()
        Specified by:
        isOpen in interface org.apache.http.HttpConnection
      • isStale

        public boolean isStale()
        Specified by:
        isStale in interface org.apache.http.HttpConnection
      • setSocketTimeout

        public void setSocketTimeout​(int timeout)
        Specified by:
        setSocketTimeout in interface org.apache.http.HttpConnection
      • getSocketTimeout

        public int getSocketTimeout()
        Specified by:
        getSocketTimeout in interface org.apache.http.HttpConnection
      • bind

        public void bind​(java.net.Socket socket)
                  throws java.io.IOException
        Description copied from interface: ManagedHttpClientConnection
        Binds this connection to the given socket. The connection is considered open if it is bound and the underlying socket is connection to a remote host.
        Specified by:
        bind in interface ManagedHttpClientConnection
        Parameters:
        socket - the socket to bind the connection to.
        Throws:
        java.io.IOException
      • getSSLSession

        public javax.net.ssl.SSLSession getSSLSession()
        Description copied from interface: ManagedHttpClientConnection
        Obtains the SSL session of the underlying connection, if any. If this connection is open, and the underlying socket is an SSLSocket, the SSL session of that socket is obtained. This is a potentially blocking operation.
        Specified by:
        getSSLSession in interface ManagedHttpClientConnection
        Returns:
        the underlying SSL session if available, null otherwise
      • isResponseAvailable

        public boolean isResponseAvailable​(int timeout)
                                    throws java.io.IOException
        Specified by:
        isResponseAvailable in interface org.apache.http.HttpClientConnection
        Throws:
        java.io.IOException
      • sendRequestHeader

        public void sendRequestHeader​(org.apache.http.HttpRequest request)
                               throws org.apache.http.HttpException,
                                      java.io.IOException
        Specified by:
        sendRequestHeader in interface org.apache.http.HttpClientConnection
        Throws:
        org.apache.http.HttpException
        java.io.IOException
      • sendRequestEntity

        public void sendRequestEntity​(org.apache.http.HttpEntityEnclosingRequest request)
                               throws org.apache.http.HttpException,
                                      java.io.IOException
        Specified by:
        sendRequestEntity in interface org.apache.http.HttpClientConnection
        Throws:
        org.apache.http.HttpException
        java.io.IOException
      • receiveResponseHeader

        public org.apache.http.HttpResponse receiveResponseHeader()
                                                           throws org.apache.http.HttpException,
                                                                  java.io.IOException
        Specified by:
        receiveResponseHeader in interface org.apache.http.HttpClientConnection
        Throws:
        org.apache.http.HttpException
        java.io.IOException
      • receiveResponseEntity

        public void receiveResponseEntity​(org.apache.http.HttpResponse response)
                                   throws org.apache.http.HttpException,
                                          java.io.IOException
        Specified by:
        receiveResponseEntity in interface org.apache.http.HttpClientConnection
        Throws:
        org.apache.http.HttpException
        java.io.IOException
      • flush

        public void flush()
                   throws java.io.IOException
        Specified by:
        flush in interface org.apache.http.HttpClientConnection
        Throws:
        java.io.IOException
      • getMetrics

        public org.apache.http.HttpConnectionMetrics getMetrics()
        Specified by:
        getMetrics in interface org.apache.http.HttpConnection
      • getLocalAddress

        public java.net.InetAddress getLocalAddress()
        Specified by:
        getLocalAddress in interface org.apache.http.HttpInetConnection
      • getLocalPort

        public int getLocalPort()
        Specified by:
        getLocalPort in interface org.apache.http.HttpInetConnection
      • getRemoteAddress

        public java.net.InetAddress getRemoteAddress()
        Specified by:
        getRemoteAddress in interface org.apache.http.HttpInetConnection
      • getRemotePort

        public int getRemotePort()
        Specified by:
        getRemotePort in interface org.apache.http.HttpInetConnection
      • getAttribute

        public java.lang.Object getAttribute​(java.lang.String id)
        Specified by:
        getAttribute in interface org.apache.http.protocol.HttpContext
      • setAttribute

        public void setAttribute​(java.lang.String id,
                                 java.lang.Object obj)
        Specified by:
        setAttribute in interface org.apache.http.protocol.HttpContext
      • removeAttribute

        public java.lang.Object removeAttribute​(java.lang.String id)
        Specified by:
        removeAttribute in interface org.apache.http.protocol.HttpContext
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • newProxy

        public static org.apache.http.HttpClientConnection newProxy​(CPoolEntry poolEntry)
      • getProxy

        private static CPoolProxy getProxy​(org.apache.http.HttpClientConnection conn)
      • getPoolEntry

        public static CPoolEntry getPoolEntry​(org.apache.http.HttpClientConnection proxy)
      • detach

        public static CPoolEntry detach​(org.apache.http.HttpClientConnection conn)