Package org.apache.http.impl.nio
Class DefaultHttpServerIODispatch<H extends NHttpServerEventHandler>
java.lang.Object
org.apache.http.impl.nio.reactor.AbstractIODispatch<DefaultNHttpServerConnection>
org.apache.http.impl.nio.DefaultHttpServerIODispatch<H>
- Type Parameters:
H
- an implementation ofNHttpServerEventHandler
.
- All Implemented Interfaces:
IOEventDispatch
@Contract(threading=IMMUTABLE_CONDITIONAL)
public class DefaultHttpServerIODispatch<H extends NHttpServerEventHandler>
extends AbstractIODispatch<DefaultNHttpServerConnection>
Default
IOEventDispatch
implementation
that supports both plain (non-encrypted) and SSL encrypted server side HTTP
connections.- Since:
- 4.2
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final NHttpConnectionFactory
<? extends DefaultNHttpServerConnection> private final H
Fields inherited from interface org.apache.http.nio.reactor.IOEventDispatch
CONNECTION_KEY
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultHttpServerIODispatch
(H handler, SSLContext sslContext, ConnectionConfig config) DefaultHttpServerIODispatch
(H handler, SSLContext sslContext, SSLSetupHandler sslHandler, ConnectionConfig config) DefaultHttpServerIODispatch
(H handler, SSLContext sslContext, SSLSetupHandler sslHandler, HttpParams params) Deprecated.DefaultHttpServerIODispatch
(H handler, SSLContext sslContext, HttpParams params) Deprecated.DefaultHttpServerIODispatch
(H handler, ConnectionConfig config) DefaultHttpServerIODispatch
(H handler, NHttpConnectionFactory<? extends DefaultNHttpServerConnection> connFactory) DefaultHttpServerIODispatch
(H handler, HttpParams params) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends NHttpServerEventHandler>
DefaultHttpServerIODispatch<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 NHttpServerEventHandler>
DefaultHttpServerIODispatch<T> create
(T eventHandler, SSLContext sslContext, ConnectionConfig config, HttpRequestFactory httpRequestFactory) Creates a new instance of this class to be used for dispatching I/O event notifications to the given protocol handler.static <T extends NHttpServerEventHandler>
DefaultHttpServerIODispatch<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 DefaultNHttpServerConnection
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
-
DefaultHttpServerIODispatch
public DefaultHttpServerIODispatch(H handler, NHttpConnectionFactory<? extends DefaultNHttpServerConnection> connFactory) -
DefaultHttpServerIODispatch
Deprecated. -
DefaultHttpServerIODispatch
@Deprecated public DefaultHttpServerIODispatch(H handler, SSLContext sslContext, SSLSetupHandler sslHandler, HttpParams params) -
DefaultHttpServerIODispatch
Deprecated. -
DefaultHttpServerIODispatch
- Since:
- 4.3
-
DefaultHttpServerIODispatch
public DefaultHttpServerIODispatch(H handler, SSLContext sslContext, SSLSetupHandler sslHandler, ConnectionConfig config) - Since:
- 4.3
-
DefaultHttpServerIODispatch
- Since:
- 4.3
-
-
Method Details
-
create
public static <T extends NHttpServerEventHandler> DefaultHttpServerIODispatch<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 server 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 NHttpServerEventHandler> DefaultHttpServerIODispatch<T> create(T eventHandler, SSLContext sslContext, ConnectionConfig config, HttpRequestFactory httpRequestFactory) Creates a new instance of this class to be used for dispatching I/O event notifications to the given protocol handler.- Parameters:
eventHandler
- the server protocol handler.sslContext
- an SSLContext or null (for a plain text connection.)config
- a connection configurationhttpRequestFactory
- the request factory used by this object to generateHttpRequest
instances.- Returns:
- a new instance
- Since:
- 4.4.10
-
create
public static <T extends NHttpServerEventHandler> DefaultHttpServerIODispatch<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 server 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<DefaultNHttpServerConnection>
-
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<DefaultNHttpServerConnection>
-
onClosed
- Specified by:
onClosed
in classAbstractIODispatch<DefaultNHttpServerConnection>
-
onException
- Specified by:
onException
in classAbstractIODispatch<DefaultNHttpServerConnection>
-
onInputReady
- Specified by:
onInputReady
in classAbstractIODispatch<DefaultNHttpServerConnection>
-
onOutputReady
- Specified by:
onOutputReady
in classAbstractIODispatch<DefaultNHttpServerConnection>
-
onTimeout
- Specified by:
onTimeout
in classAbstractIODispatch<DefaultNHttpServerConnection>
-
DefaultHttpServerIODispatch(NHttpServerEventHandler, SSLContext, SSLSetupHandler, ConnectionConfig)