org.norther.tammi.spray.servlet.chain
Class HttpServletRequestDecorator

java.lang.Object
  extended by javax.servlet.ServletRequestWrapper
      extended by org.norther.tammi.spray.filter.chain.ServletRequestWrapper
          extended by org.norther.tammi.spray.filter.chain.HttpServletRequestWrapper
              extended by org.norther.tammi.spray.protocol.chain.AbstractProtocolRequest
                  extended by org.norther.tammi.spray.servlet.chain.HttpServletRequestDecorator
All Implemented Interfaces:
EventListener, HttpServletRequest, ServletRequest, Poolable, Recyclable, FilterChainListener

public class HttpServletRequestDecorator
extends AbstractProtocolRequest

A decorator for HttpServletRequest.

Author:
Ilkka Priha

Nested Class Summary
protected  class HttpServletRequestDecorator.ConnectorRequestExtension
          The connector extension class.
 
Nested classes/interfaces inherited from class org.norther.tammi.spray.protocol.chain.AbstractProtocolRequest
AbstractProtocolRequest.ProtocolRequestExtension
 
Field Summary
 
Fields inherited from class org.norther.tammi.spray.protocol.chain.AbstractProtocolRequest
BODY_PARSED, COOKIE_SESSION, HEADERS_PARSED, REQUEST_PARSED, URI_PARSED, URL_SESSION
 
Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
 
Constructor Summary
HttpServletRequestDecorator(ServletRequest req)
          Constructs a new decorator.
 
Method Summary
 void completed(FilterChainEvent event)
          Notifies the object that a filter chain has completed.
 void dispose()
          Disposes the object after use.
 void disposed()
          A call back indicating that this instance is not needed any more and can be disposed.
protected  void drain()
          Drains a HTTP/1.1 request to guarantee a fresh stream for the next round.
 void filtered(FilterChainEvent event)
          Notifies the object that it has been activated within a filter chain.
 Object getAttribute(String name)
           
protected  ServletConnection getConnection()
          Gets the connection of the request.
protected  ServletRequest getFilteredRequest()
          Gets the filtered request.
protected  Map getParsedParameterMap()
          Gets the parsed parameters as a map of names and value arrays.
 Principal getUserPrincipal()
           
 void removeAttribute(String name)
           
 void setAttribute(String name, Object value)
           
protected  void setConnection(ServletConnection con)
          Sets the connection of the request.
 
Methods inherited from class org.norther.tammi.spray.protocol.chain.AbstractProtocolRequest
addParameter, addParameter, addParameterMap, getAuthorityURL, getAuthorityURL, getAuthorityURL, getHttpFilter, getInternalCharacterEncoding, getParameter, getParameterMap, getParameterNames, getParameterValues, getPathTail, getRedirectionURL, getVersion, isAuthentication, isRedirection, isSecureSession, removeParameter, setAuthentication, setParameter, setRedirection, setRedirectionURL
 
Methods inherited from class org.norther.tammi.spray.filter.chain.HttpServletRequestWrapper
getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole, setRequest
 
Methods inherited from class org.norther.tammi.spray.filter.chain.ServletRequestWrapper
getExtension, getFilterChain, getFilteredResponse, isDisposed, recycle, recycle, recycled, setExtension
 
Methods inherited from class javax.servlet.ServletRequestWrapper
getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequest, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, setCharacterEncoding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.ServletRequest
getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, setCharacterEncoding
 

Constructor Detail

HttpServletRequestDecorator

public HttpServletRequestDecorator(ServletRequest req)
Constructs a new decorator.

Parameters:
c - the servlet connection.
req - the decorated request.
Method Detail

dispose

public void dispose()
Description copied from interface: Recyclable
Disposes the object after use. The method is called when the object is returned to its pool. The dispose method must call its super.

Specified by:
dispose in interface Recyclable
Overrides:
dispose in class AbstractProtocolRequest

disposed

public void disposed()
Description copied from interface: Poolable
A call back indicating that this instance is not needed any more and can be disposed.

Specified by:
disposed in interface Poolable
Overrides:
disposed in class ServletRequestWrapper

getAttribute

public Object getAttribute(String name)
Specified by:
getAttribute in interface ServletRequest
Overrides:
getAttribute in class ServletRequestWrapper

setAttribute

public void setAttribute(String name,
                         Object value)
Specified by:
setAttribute in interface ServletRequest
Overrides:
setAttribute in class ServletRequestWrapper

removeAttribute

public void removeAttribute(String name)
Specified by:
removeAttribute in interface ServletRequest
Overrides:
removeAttribute in class ServletRequestWrapper

getUserPrincipal

public Principal getUserPrincipal()
Specified by:
getUserPrincipal in interface HttpServletRequest
Overrides:
getUserPrincipal in class HttpServletRequestWrapper

filtered

public void filtered(FilterChainEvent event)
Description copied from interface: FilterChainListener
Notifies the object that it has been activated within a filter chain.

Specified by:
filtered in interface FilterChainListener
Overrides:
filtered in class ServletRequestWrapper
Parameters:
event - the filter chain event.

completed

public void completed(FilterChainEvent event)
Description copied from interface: FilterChainListener
Notifies the object that a filter chain has completed.

Specified by:
completed in interface FilterChainListener
Overrides:
completed in class ServletRequestWrapper
Parameters:
event - the filter chain event.

drain

protected void drain()
Description copied from class: AbstractProtocolRequest
Drains a HTTP/1.1 request to guarantee a fresh stream for the next round.

Specified by:
drain in class AbstractProtocolRequest

getParsedParameterMap

protected Map getParsedParameterMap()
Description copied from class: AbstractProtocolRequest
Gets the parsed parameters as a map of names and value arrays.

Overrides:
getParsedParameterMap in class AbstractProtocolRequest
Returns:
the parsed parameters as a map.

getFilteredRequest

protected ServletRequest getFilteredRequest()
Description copied from class: ServletRequestWrapper
Gets the filtered request.

Overrides:
getFilteredRequest in class ServletRequestWrapper
Returns:
the filtered request.

getConnection

protected ServletConnection getConnection()
Gets the connection of the request.

Returns:
the connection.

setConnection

protected void setConnection(ServletConnection con)
Sets the connection of the request.

Parameters:
con - the connection.


Copyright © 2004 The Norther Organization. All rights reserved.