org.apache.axis2.transport.http.server
Class HttpRequestHandlerChain

java.lang.Object
  extended byorg.apache.axis2.transport.http.server.HttpRequestHandlerChain
All Implemented Interfaces:
HttpRequestHandler

public class HttpRequestHandlerChain
extends java.lang.Object
implements HttpRequestHandler

Maintains a chain of HttpRequestHandlers where new request-handlers can be prepended/appended. For each call to #processRequest(ResponseWriter,SimpleHttpServerConnection,RequestLine,Header[]) we iterate over the chain from the start to the end, stopping as soon as a handler has claimed the output.


Constructor Summary
HttpRequestHandlerChain()
           
HttpRequestHandlerChain(HttpRequestHandlerChain chain)
           
 
Method Summary
 void appendHandler(HttpRequestHandler handler)
           
 void clear()
           
 void prependHandler(HttpRequestHandler handler)
           
 boolean processRequest(SimpleHttpServerConnection conn, SimpleRequest request)
          The request handler is asked to process this request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpRequestHandlerChain

public HttpRequestHandlerChain(HttpRequestHandlerChain chain)

HttpRequestHandlerChain

public HttpRequestHandlerChain()
Method Detail

clear

public void clear()

prependHandler

public void prependHandler(HttpRequestHandler handler)

appendHandler

public void appendHandler(HttpRequestHandler handler)

processRequest

public boolean processRequest(SimpleHttpServerConnection conn,
                              SimpleRequest request)
                       throws java.io.IOException
Description copied from interface: HttpRequestHandler
The request handler is asked to process this request. If it is not capable/interested in processing it, this call should be simply ignored. Any modification of the output stream (via conn.getWriter()) by this request handler will stop the execution chain and return the output to the client. The handler may also rewrite the request parameters (this is useful in HttpRequestHandlerChain structures).

Specified by:
processRequest in interface HttpRequestHandler
Parameters:
conn - The Connection object to which this request belongs to.
request - The request object.
Returns:
true if this handler handled the request and no other handlers in the chain should be called, false otherwise.
Throws:
java.io.IOException