rabbit.handler
Class BaseHandler
java.lang.Object
rabbit.handler.BaseHandler
- All Implemented Interfaces:
- Handler
- Direct Known Subclasses:
- FilterHandler, GZIPHandler, ImageHandler
- public class BaseHandler
- extends java.lang.Object
- implements Handler
This class is an implementation of the Handler interface.
This handler does no filtering, it only sends the data as
effective as it can.
Method Summary |
void |
handle()
Handle the request. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BaseHandler
public BaseHandler(Connection con,
HTTPHeader request,
HTTPHeader response,
java.io.InputStream contentstream,
MultiOutputStream clientstream,
boolean maycache,
boolean mayfilter,
long size)
- Create a new BaseHansler for the given request.
- Parameters:
con
- the Connection handling the request.request
- the actual request made.response
- the actual response.contentstream
- the stream to read data from.clientstream
- the stream to write data to.maycache
- May we cache this request?mayfilter
- May we filter this request?size
- the size of the data beeing handled.
handle
public void handle()
throws java.io.IOException
- Handle the request.
A request is made in these steps:
writeHeader ();
addCacheStream ();
prepareStream ();
send ();
finishStream ();
finish ();
- Specified by:
handle
in interface Handler
- Throws:
java.io.IOException
- if any of the underlying methods does.