SMILA (incubation) API documentation

org.eclipse.smila.http.server.util
Class RequestDispatcher

java.lang.Object
  extended by org.eclipse.smila.http.server.util.RequestDispatcher
All Implemented Interfaces:
HttpHandler

public class RequestDispatcher
extends java.lang.Object
implements HttpHandler

Implementation of a HattpHandler that dispatches incoming requests to RequestHandlers that registered themselves with this RequestDispatcher.


Constructor Summary
RequestDispatcher()
          Default constructor.
 
Method Summary
protected  void activate(ComponentContext context)
          DS activate method.
 void addRequestHandler(RequestHandler handler)
          Add a RequestHandler..
 java.lang.String getRootContextPath()
          
 void handle(HttpExchange he)
          Handles a HttpExchange containing a HttpRequest.
 void removeRequestHandler(RequestHandler handler)
          Remove the given RequestHandler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestDispatcher

public RequestDispatcher()
Default constructor.

Method Detail

activate

protected void activate(ComponentContext context)
DS activate method.

Parameters:
context - ComponentContext

getRootContextPath

public java.lang.String getRootContextPath()

Specified by:
getRootContextPath in interface HttpHandler
Returns:
the URI path this handler is invoked for.

addRequestHandler

public void addRequestHandler(RequestHandler handler)
Add a RequestHandler..

Parameters:
handler - the new RequestHandler

removeRequestHandler

public void removeRequestHandler(RequestHandler handler)
Remove the given RequestHandler.

Parameters:
handler - the RequestHandler

handle

public void handle(HttpExchange he)
            throws java.io.IOException
Handles a HttpExchange containing a HttpRequest.

Specified by:
handle in interface HttpHandler
Parameters:
he - the HttpExchange object
Throws:
java.io.IOException - handling the request (e.g. a org.eclipse.jetty.http.HttpException)

SMILA (incubation) API documentation