Package org.apache.http.impl.nio
Class DefaultHttpClientIODispatch<H extends NHttpClientEventHandler>
java.lang.Object
org.apache.http.impl.nio.reactor.AbstractIODispatch<DefaultNHttpClientConnection>
org.apache.http.impl.nio.DefaultHttpClientIODispatch<H>
- Type Parameters:
H
- an implementation ofNHttpClientEventHandler
.
- All Implemented Interfaces:
IOEventDispatch
@Contract(threading=IMMUTABLE_CONDITIONAL)
public class DefaultHttpClientIODispatch<H extends NHttpClientEventHandler>
extends AbstractIODispatch<DefaultNHttpClientConnection>
Default
IOEventDispatch
implementation
that supports both plain (non-encrypted) and SSL encrypted client side HTTP
connections.- Since:
- 4.2
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final NHttpConnectionFactory
<? extends DefaultNHttpClientConnection> private final H
Fields inherited from interface org.apache.http.nio.reactor.IOEventDispatch
CONNECTION_KEY
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultHttpClientIODispatch
(H handler, SSLContext sslContext, ConnectionConfig config) DefaultHttpClientIODispatch
(H handler, SSLContext sslContext, SSLSetupHandler sslHandler, ConnectionConfig config) DefaultHttpClientIODispatch
(H handler, SSLContext sslContext, SSLSetupHandler sslHandler, HttpParams params) Deprecated.DefaultHttpClientIODispatch
(H handler, SSLContext sslContext, HttpParams params) Deprecated.DefaultHttpClientIODispatch
(H handler, ConnectionConfig config) DefaultHttpClientIODispatch
(H handler, NHttpConnectionFactory<? extends DefaultNHttpClientConnection> connFactory) Creates a new instance of this class to be used for dispatching I/O event notifications to the given protocol handler.DefaultHttpClientIODispatch
(H handler, HttpParams params) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends NHttpClientEventHandler>
DefaultHttpClientIODispatch<T> create
(T handler, SSLContext sslContext, ConnectionConfig config) Creates a new instance of this class to be used for dispatching I/O event notifications to the given protocol handler.static <T extends NHttpClientEventHandler>
DefaultHttpClientIODispatch<T> create
(T handler, SSLContext sslContext, SSLSetupHandler sslHandler, ConnectionConfig config) Creates a new instance of this class to be used for dispatching I/O event notifications to the given protocol handler.protected DefaultNHttpClientConnection
createConnection
(IOSession session) Gets the connection factory used to construct this dispatch.Gets the handler used to construct this dispatch.protected void
protected void
protected void
protected void
protected void
protected void
Methods inherited from class org.apache.http.impl.nio.reactor.AbstractIODispatch
connected, disconnected, inputReady, outputReady, timeout
-
Field Details
-
handler
-
connectionFactory
-
-
Constructor Details
-
DefaultHttpClientIODispatch
public DefaultHttpClientIODispatch(H handler, NHttpConnectionFactory<? extends DefaultNHttpClientConnection> connFactory) Creates a new instance of this class to be used for dispatching I/O event notifications to the given protocol handler.- Parameters:
handler
- the client protocol handler.connFactory
- HTTP client connection factory.
-
DefaultHttpClientIODispatch
Deprecated. -
DefaultHttpClientIODispatch
@Deprecated public DefaultHttpClientIODispatch(H handler, SSLContext sslContext, SSLSetupHandler sslHandler, HttpParams params) -
DefaultHttpClientIODispatch
Deprecated. -
DefaultHttpClientIODispatch
- Since:
- 4.3
-
DefaultHttpClientIODispatch
public DefaultHttpClientIODispatch(H handler, SSLContext sslContext, SSLSetupHandler sslHandler, ConnectionConfig config) - Since:
- 4.3
-
DefaultHttpClientIODispatch
- Since:
- 4.3
-
-
Method Details
-
create
public static <T extends NHttpClientEventHandler> DefaultHttpClientIODispatch<T> create(T handler, SSLContext sslContext, ConnectionConfig config) Creates a new instance of this class to be used for dispatching I/O event notifications to the given protocol handler.- Parameters:
handler
- the client protocol handler.sslContext
- an SSLContext or null (for a plain text connection.)config
- a connection configuration- Returns:
- a new instance
- Since:
- 4.4.7
-
create
public static <T extends NHttpClientEventHandler> DefaultHttpClientIODispatch<T> create(T handler, SSLContext sslContext, SSLSetupHandler sslHandler, ConnectionConfig config) Creates a new instance of this class to be used for dispatching I/O event notifications to the given protocol handler.- Parameters:
handler
- the client protocol handler.sslContext
- an SSLContext or null (for a plain text connection.)sslHandler
- customizes various aspects of the TLS/SSL protocol.config
- a connection configuration- Returns:
- a new instance
- Since:
- 4.4.7
-
createConnection
- Specified by:
createConnection
in classAbstractIODispatch<DefaultNHttpClientConnection>
-
getConnectionFactory
Gets the connection factory used to construct this dispatch.- Returns:
- the connection factory used to construct this dispatch.
- Since:
- 4.4.9
-
getHandler
Gets the handler used to construct this dispatch.- Returns:
- the handler used to construct this dispatch.
- Since:
- 4.4.9
-
onConnected
- Specified by:
onConnected
in classAbstractIODispatch<DefaultNHttpClientConnection>
-
onClosed
- Specified by:
onClosed
in classAbstractIODispatch<DefaultNHttpClientConnection>
-
onException
- Specified by:
onException
in classAbstractIODispatch<DefaultNHttpClientConnection>
-
onInputReady
- Specified by:
onInputReady
in classAbstractIODispatch<DefaultNHttpClientConnection>
-
onOutputReady
- Specified by:
onOutputReady
in classAbstractIODispatch<DefaultNHttpClientConnection>
-
onTimeout
- Specified by:
onTimeout
in classAbstractIODispatch<DefaultNHttpClientConnection>
-
DefaultHttpClientIODispatch(NHttpClientEventHandler, SSLContext, SSLSetupHandler, ConnectionConfig)