Package org.apache.http.impl.conn
Class CPoolProxy
java.lang.Object
org.apache.http.impl.conn.CPoolProxy
- All Implemented Interfaces:
Closeable
,AutoCloseable
,ManagedHttpClientConnection
,org.apache.http.HttpClientConnection
,org.apache.http.HttpConnection
,org.apache.http.HttpInetConnection
,org.apache.http.protocol.HttpContext
class CPoolProxy
extends Object
implements ManagedHttpClientConnection, org.apache.http.protocol.HttpContext
- Since:
- 4.3
-
Field Summary
FieldsFields inherited from interface org.apache.http.protocol.HttpContext
RESERVED_PREFIX
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Binds this connection to the given socket.void
close()
(package private) CPoolEntry
detach()
static CPoolEntry
detach
(org.apache.http.HttpClientConnection conn) void
flush()
getAttribute
(String id) (package private) ManagedHttpClientConnection
getId()
Returns connection ID which is expected to be unique for the life span of the connection manager.int
org.apache.http.HttpConnectionMetrics
(package private) CPoolEntry
static CPoolEntry
getPoolEntry
(org.apache.http.HttpClientConnection proxy) private static CPoolProxy
getProxy
(org.apache.http.HttpClientConnection conn) int
Returns the underlying socket.int
Obtains the SSL session of the underlying connection, if any.(package private) ManagedHttpClientConnection
boolean
isOpen()
boolean
isResponseAvailable
(int timeout) boolean
isStale()
static org.apache.http.HttpClientConnection
newProxy
(CPoolEntry poolEntry) void
receiveResponseEntity
(org.apache.http.HttpResponse response) org.apache.http.HttpResponse
void
sendRequestEntity
(org.apache.http.HttpEntityEnclosingRequest request) void
sendRequestHeader
(org.apache.http.HttpRequest request) void
setAttribute
(String id, Object obj) void
setSocketTimeout
(int timeout) void
shutdown()
toString()
-
Field Details
-
poolEntry
-
-
Constructor Details
-
CPoolProxy
CPoolProxy(CPoolEntry entry)
-
-
Method Details
-
getPoolEntry
CPoolEntry getPoolEntry() -
detach
CPoolEntry detach() -
getConnection
ManagedHttpClientConnection getConnection() -
getValidConnection
ManagedHttpClientConnection getValidConnection() -
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceorg.apache.http.HttpConnection
- Throws:
IOException
-
shutdown
- Specified by:
shutdown
in interfaceorg.apache.http.HttpConnection
- Throws:
IOException
-
isOpen
public boolean isOpen()- Specified by:
isOpen
in interfaceorg.apache.http.HttpConnection
-
isStale
public boolean isStale()- Specified by:
isStale
in interfaceorg.apache.http.HttpConnection
-
setSocketTimeout
public void setSocketTimeout(int timeout) - Specified by:
setSocketTimeout
in interfaceorg.apache.http.HttpConnection
-
getSocketTimeout
public int getSocketTimeout()- Specified by:
getSocketTimeout
in interfaceorg.apache.http.HttpConnection
-
getId
Description copied from interface:ManagedHttpClientConnection
Returns connection ID which is expected to be unique for the life span of the connection manager.- Specified by:
getId
in interfaceManagedHttpClientConnection
-
bind
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 interfaceManagedHttpClientConnection
- Parameters:
socket
- the socket to bind the connection to.- Throws:
IOException
-
getSocket
Description copied from interface:ManagedHttpClientConnection
Returns the underlying socket.- Specified by:
getSocket
in interfaceManagedHttpClientConnection
-
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 anSSLSocket
, the SSL session of that socket is obtained. This is a potentially blocking operation.- Specified by:
getSSLSession
in interfaceManagedHttpClientConnection
- Returns:
- the underlying SSL session if available,
null
otherwise
-
isResponseAvailable
- Specified by:
isResponseAvailable
in interfaceorg.apache.http.HttpClientConnection
- Throws:
IOException
-
sendRequestHeader
public void sendRequestHeader(org.apache.http.HttpRequest request) throws org.apache.http.HttpException, IOException - Specified by:
sendRequestHeader
in interfaceorg.apache.http.HttpClientConnection
- Throws:
org.apache.http.HttpException
IOException
-
sendRequestEntity
public void sendRequestEntity(org.apache.http.HttpEntityEnclosingRequest request) throws org.apache.http.HttpException, IOException - Specified by:
sendRequestEntity
in interfaceorg.apache.http.HttpClientConnection
- Throws:
org.apache.http.HttpException
IOException
-
receiveResponseHeader
public org.apache.http.HttpResponse receiveResponseHeader() throws org.apache.http.HttpException, IOException- Specified by:
receiveResponseHeader
in interfaceorg.apache.http.HttpClientConnection
- Throws:
org.apache.http.HttpException
IOException
-
receiveResponseEntity
public void receiveResponseEntity(org.apache.http.HttpResponse response) throws org.apache.http.HttpException, IOException - Specified by:
receiveResponseEntity
in interfaceorg.apache.http.HttpClientConnection
- Throws:
org.apache.http.HttpException
IOException
-
flush
- Specified by:
flush
in interfaceorg.apache.http.HttpClientConnection
- Throws:
IOException
-
getMetrics
public org.apache.http.HttpConnectionMetrics getMetrics()- Specified by:
getMetrics
in interfaceorg.apache.http.HttpConnection
-
getLocalAddress
- Specified by:
getLocalAddress
in interfaceorg.apache.http.HttpInetConnection
-
getLocalPort
public int getLocalPort()- Specified by:
getLocalPort
in interfaceorg.apache.http.HttpInetConnection
-
getRemoteAddress
- Specified by:
getRemoteAddress
in interfaceorg.apache.http.HttpInetConnection
-
getRemotePort
public int getRemotePort()- Specified by:
getRemotePort
in interfaceorg.apache.http.HttpInetConnection
-
getAttribute
- Specified by:
getAttribute
in interfaceorg.apache.http.protocol.HttpContext
-
setAttribute
- Specified by:
setAttribute
in interfaceorg.apache.http.protocol.HttpContext
-
removeAttribute
- Specified by:
removeAttribute
in interfaceorg.apache.http.protocol.HttpContext
-
toString
-
newProxy
-
getProxy
-
getPoolEntry
-
detach
-