org.archive.wayback.util.webapp
Interface RequestHandler

All Superinterfaces:
org.springframework.beans.factory.BeanNameAware
All Known Implementing Classes:
AbstractRequestHandler, AccessPoint, ARCRecordingProxy, ARCUnwrappingProxy, FileProxyServlet, LiveWebAccessPoint, ResourceFileLocationDBServlet, ServerRelativeArchivalRedirect, StaticFileRequestHandler

public interface RequestHandler
extends org.springframework.beans.factory.BeanNameAware

A generic handler of HttpServletRequests. very similar to an HttpServlet, but the handleRequest() method returns a boolean indicating if the RequestHandler returned data to the user. This interface further defines methods to facilitate automatic registration when loaded as a Spring configuration, and maintains a reference to the ServletContext under which it accepts incoming requests.

Author:
brad

Method Summary
 String getBeanName()
           
 javax.servlet.ServletContext getServletContext()
           
 boolean handleRequest(javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse)
          Possibly handle an incoming HttpServletRequest, much like a normal HttpServlet, but includes a return value.
 void registerPortListener(RequestMapper requestMapper)
          Called at webapp context initialization, to allow the RequestHandler to register itself with the RequestMapper, which will delegate request handling to the appropriate RequestHandler.
 void setServletContext(javax.servlet.ServletContext servletContext)
          Called before registerPortListener(), to enable the registration process and subsequent handleRequest() calls to access the ServletContext, via the getServletContext() method.
 String translateRequestPath(javax.servlet.http.HttpServletRequest httpRequest)
           
 String translateRequestPathQuery(javax.servlet.http.HttpServletRequest httpRequest)
           
 
Methods inherited from interface org.springframework.beans.factory.BeanNameAware
setBeanName
 

Method Detail

handleRequest

boolean handleRequest(javax.servlet.http.HttpServletRequest httpRequest,
                      javax.servlet.http.HttpServletResponse httpResponse)
                      throws javax.servlet.ServletException,
                             IOException
Possibly handle an incoming HttpServletRequest, much like a normal HttpServlet, but includes a return value.

Parameters:
httpRequest - the incoming HttpServletRequest
httpResponse - the HttpServletResponse to return data to the client.
Returns:
true if the RequestHandler returned a response to the client, false otherwise
Throws:
javax.servlet.ServletException - for usual reasons.
IOException - for usual reasons.

getBeanName

String getBeanName()
Returns:
the "name" property of the bean from the SpringConfiguration

setServletContext

void setServletContext(javax.servlet.ServletContext servletContext)
Called before registerPortListener(), to enable the registration process and subsequent handleRequest() calls to access the ServletContext, via the getServletContext() method.

Parameters:
servletContext - the ServletContext where the RequestHandler is registered.

getServletContext

javax.servlet.ServletContext getServletContext()
Returns:
the ServletContext where the RequestHandler is registered.

registerPortListener

void registerPortListener(RequestMapper requestMapper)
Called at webapp context initialization, to allow the RequestHandler to register itself with the RequestMapper, which will delegate request handling to the appropriate RequestHandler.

Parameters:
requestMapper - the RequestMapper on which this RequestHandler should register itself, including to register for notification of context shutdown.

translateRequestPath

String translateRequestPath(javax.servlet.http.HttpServletRequest httpRequest)
Parameters:
httpRequest - the HttpServletRequest being handled
Returns:
the portion of the original incoming request that falls within this RequestHandler, not including any query information

translateRequestPathQuery

String translateRequestPathQuery(javax.servlet.http.HttpServletRequest httpRequest)
Parameters:
httpRequest - the HttpServletRequest being handled
Returns:
the portion of the original incoming request that falls within this RequestHandler, including any query information


Copyright © 2005-2011 Internet Archive. All Rights Reserved.