org.norther.tammi.spray.connector.chain
Class AbstractConnectorRequest

java.lang.Object
  extended by javax.servlet.ServletRequestWrapper
      extended by org.norther.tammi.spray.filter.chain.ServletRequestWrapper
          extended by org.norther.tammi.spray.connector.chain.AbstractConnectorRequest
All Implemented Interfaces:
EventListener, ServletRequest, Poolable, Recyclable, FilterChainListener
Direct Known Subclasses:
ConnectorRequest, DispatchedRequest

public abstract class AbstractConnectorRequest
extends ServletRequestWrapper

An abstract implementation of the connector request. It implements the javax.servlet.ServletRequest interface by applying methods provided by Connection.

It also implements the ConnectorExtension interface as an inner class.

Author:
Ilkka Priha

Nested Class Summary
protected  class AbstractConnectorRequest.ConnectorRequestExtension
          The connector extension class.
 
Field Summary
protected static String PROTOCOL
          The protocol.
 
Constructor Summary
AbstractConnectorRequest(Connection c)
          Constructs a new request.
AbstractConnectorRequest(Connection c, ServletRequest req)
          Constructs a new request with a wrapped one.
 
Method Summary
 void completed(FilterChainEvent event)
          Notifies the object that a filter chain has completed.
 void dispose()
          Disposes the object after use.
 Object getAttribute(String name)
           
 Enumeration getAttributeNames()
           
 String getCharacterEncoding()
           
protected  Connection getConnection()
          Gets the connection of the request.
 int getContentLength()
           
 String getContentType()
           
protected  ServletRequest getFilteredRequest()
          Gets the filtered request.
 ServletInputStream getInputStream()
           
 String getLocalAddr()
           
 Locale getLocale()
           
 Enumeration getLocales()
           
 String getLocalName()
           
 int getLocalPort()
           
 String getParameter(String name)
           
 Map getParameterMap()
           
 Enumeration getParameterNames()
           
 String[] getParameterValues(String name)
           
 String getProtocol()
           
protected abstract  InputStream getRawInputStream()
          Gets the raw input stream.
 BufferedReader getReader()
           
 String getRealPath(String path)
           
 String getRemoteAddr()
           
 String getRemoteHost()
           
 int getRemotePort()
           
 RequestDispatcher getRequestDispatcher(String path)
           
 String getScheme()
           
 String getServerName()
           
 int getServerPort()
           
 boolean isSecure()
           
 void recycle(Connection c)
          Recycles a request.
 void recycle(Connection c, ServletRequest req)
          Recycles a wrapped request.
 void removeAttribute(String name)
           
 void setAttribute(String name, Object value)
           
 void setCharacterEncoding(String encoding)
           
 
Methods inherited from class org.norther.tammi.spray.filter.chain.ServletRequestWrapper
disposed, filtered, getExtension, getFilterChain, getFilteredResponse, isDisposed, recycle, recycle, recycled, setExtension
 
Methods inherited from class javax.servlet.ServletRequestWrapper
getRequest, setRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROTOCOL

protected static final String PROTOCOL
The protocol.

Constructor Detail

AbstractConnectorRequest

public AbstractConnectorRequest(Connection c)
Constructs a new request.

Parameters:
c - the connection.

AbstractConnectorRequest

public AbstractConnectorRequest(Connection c,
                                ServletRequest req)
Constructs a new request with a wrapped one.

Parameters:
c - the connection.
req - the wrapped request.
Method Detail

recycle

public void recycle(Connection c)
Recycles a request.

Parameters:
c - the connection.

recycle

public void recycle(Connection c,
                    ServletRequest req)
Recycles a wrapped request.

Parameters:
c - the connection.
req - the wrapped request.

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 ServletRequestWrapper

getScheme

public String getScheme()
Specified by:
getScheme in interface ServletRequest
Overrides:
getScheme in class ServletRequestWrapper

getProtocol

public String getProtocol()
Specified by:
getProtocol in interface ServletRequest
Overrides:
getProtocol in class ServletRequestWrapper

getServerName

public String getServerName()
Specified by:
getServerName in interface ServletRequest
Overrides:
getServerName in class ServletRequestWrapper

getServerPort

public int getServerPort()
Specified by:
getServerPort in interface ServletRequest
Overrides:
getServerPort in class ServletRequestWrapper

getRemotePort

public int getRemotePort()
Specified by:
getRemotePort in interface ServletRequest
Overrides:
getRemotePort in class ServletRequestWrapper

getRemoteAddr

public String getRemoteAddr()
Specified by:
getRemoteAddr in interface ServletRequest
Overrides:
getRemoteAddr in class ServletRequestWrapper

getRemoteHost

public String getRemoteHost()
Specified by:
getRemoteHost in interface ServletRequest
Overrides:
getRemoteHost in class ServletRequestWrapper

getLocalName

public String getLocalName()
Specified by:
getLocalName in interface ServletRequest
Overrides:
getLocalName in class ServletRequestWrapper

getLocalPort

public int getLocalPort()
Specified by:
getLocalPort in interface ServletRequest
Overrides:
getLocalPort in class ServletRequestWrapper

getLocalAddr

public String getLocalAddr()
Specified by:
getLocalAddr in interface ServletRequest
Overrides:
getLocalAddr in class ServletRequestWrapper

isSecure

public boolean isSecure()
Specified by:
isSecure in interface ServletRequest
Overrides:
isSecure in class ServletRequestWrapper

getContentType

public String getContentType()
Specified by:
getContentType in interface ServletRequest
Overrides:
getContentType in class ServletRequestWrapper

getContentLength

public int getContentLength()
Specified by:
getContentLength in interface ServletRequest
Overrides:
getContentLength in class ServletRequestWrapper

getCharacterEncoding

public String getCharacterEncoding()
Specified by:
getCharacterEncoding in interface ServletRequest
Overrides:
getCharacterEncoding in class ServletRequestWrapper

setCharacterEncoding

public void setCharacterEncoding(String encoding)
                          throws UnsupportedEncodingException
Specified by:
setCharacterEncoding in interface ServletRequest
Overrides:
setCharacterEncoding in class ServletRequestWrapper
Throws:
UnsupportedEncodingException

getLocale

public Locale getLocale()
Specified by:
getLocale in interface ServletRequest
Overrides:
getLocale in class ServletRequestWrapper

getLocales

public Enumeration getLocales()
Specified by:
getLocales in interface ServletRequest
Overrides:
getLocales 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

getAttributeNames

public Enumeration getAttributeNames()
Specified by:
getAttributeNames in interface ServletRequest
Overrides:
getAttributeNames in class ServletRequestWrapper

getParameter

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

getParameterValues

public String[] getParameterValues(String name)
Specified by:
getParameterValues in interface ServletRequest
Overrides:
getParameterValues in class ServletRequestWrapper

getParameterNames

public Enumeration getParameterNames()
Specified by:
getParameterNames in interface ServletRequest
Overrides:
getParameterNames in class ServletRequestWrapper

getParameterMap

public Map getParameterMap()
Specified by:
getParameterMap in interface ServletRequest
Overrides:
getParameterMap in class ServletRequestWrapper

getInputStream

public ServletInputStream getInputStream()
                                  throws IOException
Specified by:
getInputStream in interface ServletRequest
Overrides:
getInputStream in class ServletRequestWrapper
Throws:
IOException

getReader

public BufferedReader getReader()
                         throws IOException
Specified by:
getReader in interface ServletRequest
Overrides:
getReader in class ServletRequestWrapper
Throws:
IOException

getRequestDispatcher

public RequestDispatcher getRequestDispatcher(String path)
Specified by:
getRequestDispatcher in interface ServletRequest
Overrides:
getRequestDispatcher in class ServletRequestWrapper

getRealPath

public String getRealPath(String path)
Specified by:
getRealPath in interface ServletRequest
Overrides:
getRealPath in class ServletRequestWrapper

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.

getFilteredRequest

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

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

getRawInputStream

protected abstract InputStream getRawInputStream()
Gets the raw input stream.

Returns:
the raw input stream or null.

getConnection

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

Returns:
the connection.


Copyright © 2004 The Norther Organization. All rights reserved.