public class ServerHandler extends Object implements org.apache.http.nio.NHttpServerEventHandler
Modifier and Type | Field and Description |
---|---|
static String |
CONNECTION_CREATION_TIME |
static String |
REQUEST_SINK_BUFFER |
static String |
RESPONSE_SOURCE_BUFFER |
static String |
SERVER_CONNECTION_DEBUG |
Constructor and Description |
---|
ServerHandler(ListenerContext listenerContext) |
Modifier and Type | Method and Description |
---|---|
void |
closed(org.apache.http.nio.NHttpServerConnection conn) |
void |
commitResponse(org.apache.http.nio.NHttpServerConnection conn,
org.apache.http.HttpResponse response)
Commit the response to the connection.
|
void |
commitResponseHideExceptions(org.apache.http.nio.NHttpServerConnection conn,
org.apache.http.HttpResponse response)
Commit the response to the connection.
|
void |
connected(org.apache.http.nio.NHttpServerConnection conn) |
void |
endOfInput(org.apache.http.nio.NHttpServerConnection conn) |
void |
exception(org.apache.http.nio.NHttpServerConnection conn,
Exception e) |
void |
exception(org.apache.http.nio.NHttpServerConnection conn,
org.apache.http.HttpException e)
Handle HTTP Protocol violations with an error response
|
void |
exception(org.apache.http.nio.NHttpServerConnection conn,
IOException e)
Handle IO errors while reading or writing to underlying channels
|
int |
getActiveConnectionsSize() |
int |
getActiveCount() |
org.apache.axis2.transport.base.MetricsCollector |
getMetrics() |
int |
getQueueSize() |
void |
inputReady(org.apache.http.nio.NHttpServerConnection conn,
org.apache.http.nio.ContentDecoder decoder)
Process ready input by writing it into the Pipe
|
void |
markActiveConnectionsToBeClosed() |
void |
outputReady(org.apache.http.nio.NHttpServerConnection conn,
org.apache.http.nio.ContentEncoder encoder)
Process ready output by writing into the channel
|
void |
requestReceived(org.apache.http.nio.NHttpServerConnection conn)
Process a new incoming request
|
void |
responseReady(org.apache.http.nio.NHttpServerConnection conn) |
void |
stop() |
void |
timeout(org.apache.http.nio.NHttpServerConnection conn)
Handle connection timeouts by shutting down the connections
|
public static final String REQUEST_SINK_BUFFER
public static final String RESPONSE_SOURCE_BUFFER
public static final String CONNECTION_CREATION_TIME
public static final String SERVER_CONNECTION_DEBUG
public ServerHandler(ListenerContext listenerContext)
public void requestReceived(org.apache.http.nio.NHttpServerConnection conn)
requestReceived
in interface org.apache.http.nio.NHttpServerEventHandler
conn
- the connectionpublic void inputReady(org.apache.http.nio.NHttpServerConnection conn, org.apache.http.nio.ContentDecoder decoder)
inputReady
in interface org.apache.http.nio.NHttpServerEventHandler
conn
- the connection being processeddecoder
- the content decoder in usepublic void outputReady(org.apache.http.nio.NHttpServerConnection conn, org.apache.http.nio.ContentEncoder encoder)
outputReady
in interface org.apache.http.nio.NHttpServerEventHandler
conn
- the connection being processedencoder
- the content encoder in usepublic void commitResponseHideExceptions(org.apache.http.nio.NHttpServerConnection conn, org.apache.http.HttpResponse response)
conn
- the connection being processedresponse
- the response to commit over the connectionpublic void commitResponse(org.apache.http.nio.NHttpServerConnection conn, org.apache.http.HttpResponse response) throws IOException, org.apache.http.HttpException
conn
- the connection being processedresponse
- the response to commit over the connectionIOException
- if an IO error occurs while sending the responseorg.apache.http.HttpException
- if a HTTP protocol violation occurs while sending the responsepublic void timeout(org.apache.http.nio.NHttpServerConnection conn)
timeout
in interface org.apache.http.nio.NHttpServerEventHandler
conn
- the connection being processedpublic void connected(org.apache.http.nio.NHttpServerConnection conn)
connected
in interface org.apache.http.nio.NHttpServerEventHandler
public void responseReady(org.apache.http.nio.NHttpServerConnection conn)
responseReady
in interface org.apache.http.nio.NHttpServerEventHandler
public void closed(org.apache.http.nio.NHttpServerConnection conn)
closed
in interface org.apache.http.nio.NHttpServerEventHandler
public void markActiveConnectionsToBeClosed()
public void exception(org.apache.http.nio.NHttpServerConnection conn, org.apache.http.HttpException e)
conn
- the connection being processede
- the exception encounteredpublic void endOfInput(org.apache.http.nio.NHttpServerConnection conn) throws IOException
endOfInput
in interface org.apache.http.nio.NHttpServerEventHandler
IOException
public void exception(org.apache.http.nio.NHttpServerConnection conn, Exception e)
exception
in interface org.apache.http.nio.NHttpServerEventHandler
public void exception(org.apache.http.nio.NHttpServerConnection conn, IOException e)
conn
- the connection being processede
- the exception encounteredpublic int getActiveConnectionsSize()
public int getActiveCount()
public int getQueueSize()
public org.apache.axis2.transport.base.MetricsCollector getMetrics()
public void stop()
Copyright © 2005-2017 Apache Software Foundation. All Rights Reserved.