org.mortbay.http.handler
Class AbstractHttpHandler

java.lang.Object
  |
  +--org.mortbay.http.handler.AbstractHttpHandler
All Implemented Interfaces:
HttpHandler, LifeCycle, java.io.Serializable
Direct Known Subclasses:
DumpHandler, ErrorPageHandler, ExpiryHandler, ForwardHandler, HTAccessHandler, IPAccessHandler, NotFoundHandler, NullHandler, ProxyHandler, ResourceHandler, SecurityHandler, ServletHandler, SetResponseHeadersHandler

public abstract class AbstractHttpHandler
extends java.lang.Object
implements HttpHandler

Base HTTP Handler. This No-op handler is a good base for other handlers

Version:
$Id: AbstractHttpHandler.java,v 1.5 2003/05/22 17:10:03 gregwilkins Exp $
Author:
Greg Wilkins (gregw)
See Also:
Serialized Form

Constructor Summary
AbstractHttpHandler()
           
 
Method Summary
 HttpContext getHttpContext()
           
 java.lang.String getName()
          Get the name of the handler.
 void handleTrace(HttpRequest request, HttpResponse response)
           
 void initialize(HttpContext context)
          Initialize with a HttpContext.
 boolean isStarted()
           
 void setName(java.lang.String name)
           
 void start()
          Start the LifeCycle.
 void stop()
          Stop the LifeCycle.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mortbay.http.HttpHandler
handle
 

Constructor Detail

AbstractHttpHandler

public AbstractHttpHandler()
Method Detail

setName

public void setName(java.lang.String name)

getName

public java.lang.String getName()
Description copied from interface: HttpHandler
Get the name of the handler.

Specified by:
getName in interface HttpHandler
Returns:
The name of the handler used for logging and reporting.

getHttpContext

public HttpContext getHttpContext()
Specified by:
getHttpContext in interface HttpHandler

initialize

public void initialize(HttpContext context)
Initialize with a HttpContext. Called by addHandler methods of HttpContext.

Specified by:
initialize in interface HttpHandler
Parameters:
context - Must be the HttpContext of the handler

start

public void start()
           throws java.lang.Exception
Description copied from interface: LifeCycle
Start the LifeCycle.

Specified by:
start in interface LifeCycle
Throws:
java.lang.Exception - An arbitrary exception may be thrown.

stop

public void stop()
          throws java.lang.InterruptedException
Description copied from interface: LifeCycle
Stop the LifeCycle. The LifeCycle may wait for current activities to complete normally, but it can be interrupted.

Specified by:
stop in interface LifeCycle
Throws:
java.lang.InterruptedException - Stopping a lifecycle is rarely atomic and may be interrupted by another thread. If this happens InterruptedException is throw and the component will be in an indeterminant state and should probably be discarded.

isStarted

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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

handleTrace

public void handleTrace(HttpRequest request,
                        HttpResponse response)
                 throws java.io.IOException
java.io.IOException


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