org.mortbay.http
Interface HttpHandler

All Superinterfaces:
LifeCycle
All Known Implementing Classes:
NullHandler

public interface HttpHandler
extends LifeCycle

HTTP request handler.

Version:
$Id: HttpHandler.java,v 1.1 2001/09/02 01:13:08 gregwilkins Exp $
Author:
Greg Wilkins (gregw)

Method Summary
 void destroy()
          Destroy the handler.
 HandlerContext getHandlerContext()
           
 java.lang.String getName()
           
 void handle(java.lang.String pathInContext, java.lang.String pathParams, HttpRequest request, HttpResponse response)
          Handle a request.
 void initialize(HandlerContext context)
           
 boolean isDestroyed()
           
 boolean isStarted()
           
 void start()
          Start the handler.
 void stop()
          Stop the handler.
 

Method Detail

getName

public java.lang.String getName()

getHandlerContext

public HandlerContext getHandlerContext()

initialize

public void initialize(HandlerContext context)

start

public void start()
           throws java.lang.Exception
Start the handler. All requests are ignored until start is called.
Specified by:
start in interface LifeCycle
Following copied from interface: org.mortbay.util.LifeCycle
Throws:
java.lang.Exception - An arbitrary exception may be thrown.

stop

public void stop()
          throws java.lang.InterruptedException
Stop the handler. New requests are refused and the handler may attempt to wait for existing requests to complete. The caller may interrupt the stop call is waiting is taking too long.
Specified by:
stop in interface LifeCycle

destroy

public void destroy()
Destroy the handler. New requests are refused and all current requests are immediately terminated.
Specified by:
destroy in interface LifeCycle

isStarted

public boolean isStarted()
Specified by:
isStarted in interface LifeCycle
Returns:
True if the handler has been started.

isDestroyed

public boolean isDestroyed()
Specified by:
isDestroyed in interface LifeCycle
Returns:
True if the handler has been destroyed.

handle

public void handle(java.lang.String pathInContext,
                   java.lang.String pathParams,
                   HttpRequest request,
                   HttpResponse response)
            throws HttpException,
                   java.io.IOException
Handle a request.
Parameters:
pathInContext - The context path
pathParams - Path parameters such as encoded Session ID
request - The request
response - The response.


Copyright © 2000 Mortbay Consulting Pty. Ltd. All Rights Reserved.