public class DefaultServerIOEventDispatch extends Object implements IOEventDispatch
IOEventDispatch
interface for plain
(unencrypted) server-side HTTP connections.
The following parameters can be used to customize the behavior of this class:
Modifier and Type | Field and Description |
---|---|
protected ByteBufferAllocator |
allocator |
protected NHttpServiceHandler |
handler |
protected HttpParams |
params |
Constructor and Description |
---|
DefaultServerIOEventDispatch(NHttpServiceHandler handler,
HttpParams params)
Creates a new instance of this class to be used for dispatching I/O event
notifications to the given protocol handler.
|
Modifier and Type | Method and Description |
---|---|
void |
connected(IOSession session)
Triggered after the given session has been just created.
|
protected ByteBufferAllocator |
createByteBufferAllocator()
Creates an instance of
HeapByteBufferAllocator to be used
by HTTP connections for allocating ByteBuffer objects. |
protected NHttpServerIOTarget |
createConnection(IOSession session)
Creates an instance of
DefaultNHttpServerConnection based on the
given IOSession . |
protected HttpRequestFactory |
createHttpRequestFactory()
Creates an instance of
DefaultHttpRequestFactory to be used
by HTTP connections for creating HttpRequest objects. |
void |
disconnected(IOSession session)
Triggered when the given session has been terminated.
|
void |
inputReady(IOSession session)
Triggered when the given session has input pending.
|
void |
outputReady(IOSession session)
Triggered when the given session is ready for output.
|
void |
timeout(IOSession session)
Triggered when the given session as timed out.
|
protected final ByteBufferAllocator allocator
protected final NHttpServiceHandler handler
protected final HttpParams params
public DefaultServerIOEventDispatch(NHttpServiceHandler handler, HttpParams params)
handler
- the server protocol handler.params
- HTTP parameters.protected ByteBufferAllocator createByteBufferAllocator()
HeapByteBufferAllocator
to be used
by HTTP connections for allocating ByteBuffer
objects.
This method can be overridden in a super class in order to provide
a different implementation of the ByteBufferAllocator
interface.
protected HttpRequestFactory createHttpRequestFactory()
DefaultHttpRequestFactory
to be used
by HTTP connections for creating HttpRequest
objects.
This method can be overridden in a super class in order to provide
a different implementation of the HttpRequestFactory
interface.
protected NHttpServerIOTarget createConnection(IOSession session)
DefaultNHttpServerConnection
based on the
given IOSession
.
This method can be overridden in a super class in order to provide
a different implementation of the NHttpServerIOTarget
interface.
session
- the underlying I/O session.public void connected(IOSession session)
IOEventDispatch
connected
in interface IOEventDispatch
session
- the I/O session.public void disconnected(IOSession session)
IOEventDispatch
disconnected
in interface IOEventDispatch
session
- the I/O session.public void inputReady(IOSession session)
IOEventDispatch
inputReady
in interface IOEventDispatch
session
- the I/O session.public void outputReady(IOSession session)
IOEventDispatch
outputReady
in interface IOEventDispatch
session
- the I/O session.public void timeout(IOSession session)
IOEventDispatch
timeout
in interface IOEventDispatch
session
- the I/O session.Copyright © 2005-2012 The Apache Software Foundation. All Rights Reserved.