|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--rabbit.handler.BaseHandler
This class is an implementation of the Handler interface. This handler does no filtering, it only sends the data as effective as it can.
Field Summary | |
protected java.io.OutputStream |
cacheStream
The cache stream if available. |
protected MultiOutputStream |
clientstream
The stream to send data to. |
protected Connection |
con
The Connection handling the request. |
protected java.io.InputStream |
contentstream
The stream to read data from. |
protected NCacheEntry |
entry
The cache entry if available. |
protected boolean |
maycache
May we cache this request. |
protected boolean |
mayfilter
May we filter this request |
protected HTTPHeader |
request
The actual request made. |
protected HTTPHeader |
response
The actual response. |
protected long |
size
The length of the data beeing handled or -1 if unknown. |
Constructor Summary | |
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. |
Method Summary | |
protected void |
addCacheStream()
Set up the cache stream if available. |
protected void |
finish()
Close nesseccary files and adjust the cached files. |
protected void |
finishStream()
This method is used to finish the stream for the data being sent. |
void |
handle()
Handle the request. |
protected void |
prepareStream()
This method is used to prepare the stream for the data being sent. |
protected void |
removeCache(java.lang.Exception e)
Remove the cachestream and the cache entry. |
protected void |
send()
Send the actual data. |
protected void |
setPartialContent(long got,
long shouldbe)
|
protected void |
writeHeader()
Write the response header |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Connection con
protected HTTPHeader request
protected HTTPHeader response
protected java.io.InputStream contentstream
protected MultiOutputStream clientstream
protected boolean maycache
protected boolean mayfilter
protected NCacheEntry entry
protected java.io.OutputStream cacheStream
protected long size
Constructor Detail |
public BaseHandler(Connection con, HTTPHeader request, HTTPHeader response, java.io.InputStream contentstream, MultiOutputStream clientstream, boolean maycache, boolean mayfilter, long size)
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.Method Detail |
protected void writeHeader() throws java.io.IOException
java.io.IOException
- if writing the response fails.protected void addCacheStream() throws java.io.IOException
java.io.IOException
- if a cachestream couldnt be set up.protected void prepareStream() throws java.io.IOException
java.io.IOException
protected void send() throws java.io.IOException
java.io.IOException
- if reading or writing of the data fails.protected void setPartialContent(long got, long shouldbe)
protected void finishStream() throws java.io.IOException
java.io.IOException
protected void finish() throws java.io.IOException
java.io.IOException
- if closing the files does.public void handle() throws java.io.IOException
handle
in interface Handler
java.io.IOException
- if any of the underlying methods does.protected void removeCache(java.lang.Exception e)
e
- the Exception that happened
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |