org.apache.axis2.transport.nhttp
Class ServerHandler

java.lang.Object
  extended by org.apache.axis2.transport.nhttp.ServerHandler
All Implemented Interfaces:
org.apache.http.nio.NHttpServiceHandler

public class ServerHandler
extends java.lang.Object
implements org.apache.http.nio.NHttpServiceHandler

The server connection handler. An instance of this class is used by each IOReactor, to process every connection. Hence this class should not store any data related to a single connection - as this is being shared.


Constructor Summary
ServerHandler(ConfigurationContext cfgCtx, org.apache.http.params.HttpParams params, boolean isHttps)
           
 
Method Summary
 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 connected(org.apache.http.nio.NHttpServerConnection conn)
           
 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, java.io.IOException e)
          Handle IO errors while reading or writing to underlying channels
 void inputReady(org.apache.http.nio.NHttpServerConnection conn, org.apache.http.nio.ContentDecoder decoder)
          Process ready input by writing it into the Pipe
 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 timeout(org.apache.http.nio.NHttpServerConnection conn)
          Handle connection timeouts by shutting down the connections
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerHandler

public ServerHandler(ConfigurationContext cfgCtx,
                     org.apache.http.params.HttpParams params,
                     boolean isHttps)
Method Detail

requestReceived

public void requestReceived(org.apache.http.nio.NHttpServerConnection conn)
Process a new incoming request

Specified by:
requestReceived in interface org.apache.http.nio.NHttpServiceHandler
Parameters:
conn - the connection

inputReady

public void inputReady(org.apache.http.nio.NHttpServerConnection conn,
                       org.apache.http.nio.ContentDecoder decoder)
Process ready input by writing it into the Pipe

Specified by:
inputReady in interface org.apache.http.nio.NHttpServiceHandler
Parameters:
conn - the connection being processed
decoder - the content decoder in use

responseReady

public void responseReady(org.apache.http.nio.NHttpServerConnection conn)
Specified by:
responseReady in interface org.apache.http.nio.NHttpServiceHandler

outputReady

public void outputReady(org.apache.http.nio.NHttpServerConnection conn,
                        org.apache.http.nio.ContentEncoder encoder)
Process ready output by writing into the channel

Specified by:
outputReady in interface org.apache.http.nio.NHttpServiceHandler
Parameters:
conn - the connection being processed
encoder - the content encoder in use

commitResponse

public void commitResponse(org.apache.http.nio.NHttpServerConnection conn,
                           org.apache.http.HttpResponse response)
Commit the response to the connection. Processes the response through the configured HttpProcessor and submits it to be sent out

Parameters:
conn - the connection being processed
response - the response to commit over the connection

timeout

public void timeout(org.apache.http.nio.NHttpServerConnection conn)
Handle connection timeouts by shutting down the connections

Specified by:
timeout in interface org.apache.http.nio.NHttpServiceHandler
Parameters:
conn - the connection being processed

connected

public void connected(org.apache.http.nio.NHttpServerConnection conn)
Specified by:
connected in interface org.apache.http.nio.NHttpServiceHandler

closed

public void closed(org.apache.http.nio.NHttpServerConnection conn)
Specified by:
closed in interface org.apache.http.nio.NHttpServiceHandler

exception

public void exception(org.apache.http.nio.NHttpServerConnection conn,
                      org.apache.http.HttpException e)
Handle HTTP Protocol violations with an error response

Specified by:
exception in interface org.apache.http.nio.NHttpServiceHandler
Parameters:
conn - the connection being processed
e - the exception encountered

exception

public void exception(org.apache.http.nio.NHttpServerConnection conn,
                      java.io.IOException e)
Handle IO errors while reading or writing to underlying channels

Specified by:
exception in interface org.apache.http.nio.NHttpServiceHandler
Parameters:
conn - the connection being processed
e - the exception encountered


Copyright © 2007 Apache Web Services Project. All Rights Reserved.