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

java.lang.Object
  extended by javax.servlet.ServletResponseWrapper
      extended by org.norther.tammi.spray.filter.chain.ServletResponseWrapper
          extended by org.norther.tammi.spray.connector.chain.AbstractConnectorResponse
All Implemented Interfaces:
EventListener, ServletResponse, Poolable, Recyclable, FilterChainListener
Direct Known Subclasses:
ConnectorResponse

public abstract class AbstractConnectorResponse
extends ServletResponseWrapper

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

Author:
Ilkka Priha

Constructor Summary
AbstractConnectorResponse()
          Constructs a new response.
AbstractConnectorResponse(ServletResponse res)
          Constructs a new response with a wrapped one.
 
Method Summary
 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.
 void flushBuffer()
           
 int getBufferSize()
           
protected  int getByteCount()
          Gets the byte count of the output stream.
 String getCharacterEncoding()
           
 String getContentType()
           
 Locale getLocale()
           
 ServletOutputStream getOutputStream()
           
protected abstract  OutputStream getRawOutputStream()
          Gets the raw output stream.
 PrintWriter getWriter()
           
 boolean isCommitted()
           
 void reset()
           
 void resetBuffer()
           
 void setBufferSize(int size)
           
 void setCharacterEncoding(String enc)
           
 void setContentLength(int value)
           
 void setContentType(String type)
           
 void setLocale(Locale locale)
           
 
Methods inherited from class org.norther.tammi.spray.filter.chain.ServletResponseWrapper
completed, filtered, getExtension, getFilterChain, getFilteredRequest, getFilteredResponse, isDisposed, recycle, recycle, recycled
 
Methods inherited from class javax.servlet.ServletResponseWrapper
getResponse, setResponse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractConnectorResponse

public AbstractConnectorResponse()
Constructs a new response.


AbstractConnectorResponse

public AbstractConnectorResponse(ServletResponse res)
Constructs a new response with a wrapped one.

Parameters:
res - the wrapped response.
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 ServletResponseWrapper

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 ServletResponseWrapper

setContentLength

public void setContentLength(int value)
Specified by:
setContentLength in interface ServletResponse
Overrides:
setContentLength in class ServletResponseWrapper

getContentType

public String getContentType()
Specified by:
getContentType in interface ServletResponse
Overrides:
getContentType in class ServletResponseWrapper

setContentType

public void setContentType(String type)
Specified by:
setContentType in interface ServletResponse
Overrides:
setContentType in class ServletResponseWrapper

getCharacterEncoding

public String getCharacterEncoding()
Specified by:
getCharacterEncoding in interface ServletResponse
Overrides:
getCharacterEncoding in class ServletResponseWrapper

setCharacterEncoding

public void setCharacterEncoding(String enc)
Specified by:
setCharacterEncoding in interface ServletResponse
Overrides:
setCharacterEncoding in class ServletResponseWrapper

getLocale

public Locale getLocale()
Specified by:
getLocale in interface ServletResponse
Overrides:
getLocale in class ServletResponseWrapper

setLocale

public void setLocale(Locale locale)
Specified by:
setLocale in interface ServletResponse
Overrides:
setLocale in class ServletResponseWrapper

getOutputStream

public ServletOutputStream getOutputStream()
                                    throws IOException
Specified by:
getOutputStream in interface ServletResponse
Overrides:
getOutputStream in class ServletResponseWrapper
Throws:
IOException

getWriter

public PrintWriter getWriter()
                      throws IOException
Specified by:
getWriter in interface ServletResponse
Overrides:
getWriter in class ServletResponseWrapper
Throws:
IOException

isCommitted

public boolean isCommitted()
Specified by:
isCommitted in interface ServletResponse
Overrides:
isCommitted in class ServletResponseWrapper

reset

public void reset()
Specified by:
reset in interface ServletResponse
Overrides:
reset in class ServletResponseWrapper

resetBuffer

public void resetBuffer()
Specified by:
resetBuffer in interface ServletResponse
Overrides:
resetBuffer in class ServletResponseWrapper

flushBuffer

public void flushBuffer()
                 throws IOException
Specified by:
flushBuffer in interface ServletResponse
Overrides:
flushBuffer in class ServletResponseWrapper
Throws:
IOException

getBufferSize

public int getBufferSize()
Specified by:
getBufferSize in interface ServletResponse
Overrides:
getBufferSize in class ServletResponseWrapper

setBufferSize

public void setBufferSize(int size)
Specified by:
setBufferSize in interface ServletResponse
Overrides:
setBufferSize in class ServletResponseWrapper

getRawOutputStream

protected abstract OutputStream getRawOutputStream()
Gets the raw output stream.

Returns:
the raw output stream or null.

getByteCount

protected int getByteCount()
Gets the byte count of the output stream.

Returns:
the byte count.


Copyright © 2004 The Norther Organization. All rights reserved.