org.norther.tammi.spray.protocol.chain
Class HttpRelayResponse

java.lang.Object
  extended by javax.servlet.ServletResponseWrapper
      extended by org.norther.tammi.spray.filter.chain.ServletResponseWrapper
          extended by org.norther.tammi.spray.protocol.chain.HttpRelayResponse
All Implemented Interfaces:
Runnable, EventListener, ServletResponse, Poolable, Recyclable, FilterChainListener

public final class HttpRelayResponse
extends ServletResponseWrapper
implements Runnable

A HTTP relay response.

Author:
Ilkka Priha

Constructor Summary
HttpRelayResponse()
          Constructs a new response.
HttpRelayResponse(ServletResponse res)
          Constructs a new response with a wrapped one.
 
Method Summary
 void dispose()
          Disposes the object after use.
 boolean isRelaying()
          Checks the relaying status.
 void relay(InputStream in)
          Relays the response.
 void run()
          Relays until the stream is closed.
 
Methods inherited from class org.norther.tammi.spray.filter.chain.ServletResponseWrapper
completed, disposed, filtered, getExtension, getFilterChain, getFilteredRequest, getFilteredResponse, isDisposed, recycle, recycle, recycled
 
Methods inherited from class javax.servlet.ServletResponseWrapper
flushBuffer, getBufferSize, getCharacterEncoding, getContentType, getLocale, getOutputStream, getResponse, getWriter, isCommitted, reset, resetBuffer, setBufferSize, setCharacterEncoding, setContentLength, setContentType, setLocale, setResponse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpRelayResponse

public HttpRelayResponse()
Constructs a new response.


HttpRelayResponse

public HttpRelayResponse(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

isRelaying

public boolean isRelaying()
Checks the relaying status.

Returns:
true if still relaying.

relay

public void relay(InputStream in)
           throws IOException
Relays the response.

Parameters:
in - the relayed input stream.
Throws:
IOException - for parsing errors.

run

public void run()
Relays until the stream is closed.

Specified by:
run in interface Runnable


Copyright © 2004 The Norther Organization. All rights reserved.