|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.http.impl.conn.DefaultClientConnectionOperator
@ThreadSafe public class DefaultClientConnectionOperator
Default implementation of a ClientConnectionOperator
. It uses
a SchemeRegistry
to look up SocketFactory
objects.
The following parameters can be used to customize the behavior of this class:
CoreProtocolPNames.HTTP_ELEMENT_CHARSET
CoreConnectionPNames.TCP_NODELAY
CoreConnectionPNames.SO_TIMEOUT
CoreConnectionPNames.SO_LINGER
CoreConnectionPNames.SOCKET_BUFFER_SIZE
CoreConnectionPNames.MAX_LINE_LENGTH
Field Summary | |
---|---|
protected SchemeRegistry |
schemeRegistry
The scheme registry for looking up socket factories. |
Constructor Summary | |
---|---|
DefaultClientConnectionOperator(SchemeRegistry schemes)
Creates a new client connection operator for the given scheme registry. |
Method Summary | |
---|---|
OperatedClientConnection |
createConnection()
Creates a new connection that can be operated. |
void |
openConnection(OperatedClientConnection conn,
HttpHost target,
InetAddress local,
HttpContext context,
HttpParams params)
Opens a connection to the given target host. |
protected void |
prepareSocket(Socket sock,
HttpContext context,
HttpParams params)
Performs standard initializations on a newly created socket. |
void |
updateSecureConnection(OperatedClientConnection conn,
HttpHost target,
HttpContext context,
HttpParams params)
Updates a connection with a layered secure connection. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final SchemeRegistry schemeRegistry
Constructor Detail |
---|
public DefaultClientConnectionOperator(SchemeRegistry schemes)
schemes
- the scheme registryMethod Detail |
---|
public OperatedClientConnection createConnection()
ClientConnectionOperator
createConnection
in interface ClientConnectionOperator
public void openConnection(OperatedClientConnection conn, HttpHost target, InetAddress local, HttpContext context, HttpParams params) throws IOException
ClientConnectionOperator
openConnection
in interface ClientConnectionOperator
conn
- the connection to opentarget
- the target host to connect tolocal
- the local address to route from, or
null
for the defaultcontext
- the context for the connectionparams
- the parameters for the connection
IOException
- in case of a problempublic void updateSecureConnection(OperatedClientConnection conn, HttpHost target, HttpContext context, HttpParams params) throws IOException
ClientConnectionOperator
updateSecureConnection
in interface ClientConnectionOperator
conn
- the open connection to updatetarget
- the target host for the updated connection.
The connection must already be open or tunnelled
to the host and port, but the scheme of the target
will be used to create a layered connection.context
- the context for the connectionparams
- the parameters for the updated connection
IOException
- in case of a problemprotected void prepareSocket(Socket sock, HttpContext context, HttpParams params) throws IOException
sock
- the socket to preparecontext
- the context for the connectionparams
- the parameters from which to prepare the socket
IOException
- in case of an IO problem
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |