rabbit.httpio
Class HttpHeaderSender

java.lang.Object
  extended by rabbit.httpio.HttpHeaderSender
All Implemented Interfaces:
AsyncListener, BlockSentListener

public class HttpHeaderSender
extends Object
implements BlockSentListener

A handler that writes http headers

Author:
Robert Olofsson

Constructor Summary
HttpHeaderSender(SocketChannel channel, NioHandler nioHandler, TrafficLogger tl, HttpHeader header, boolean fullURI, HttpHeaderSentListener sender)
           
 
Method Summary
 void blockSent()
          The http header has been sent.
 void failed(Exception cause)
          Reading failed
 void sendHeader()
          Send the header
 void timeout()
          The operation timed out
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpHeaderSender

public HttpHeaderSender(SocketChannel channel,
                        NioHandler nioHandler,
                        TrafficLogger tl,
                        HttpHeader header,
                        boolean fullURI,
                        HttpHeaderSentListener sender)
                 throws IOException
Parameters:
channel - the SocketChannel to write the header to
nioHandler - the NioHandler to use to wait for write ready
tl - the statics gatherer to use
header - the HttpHeader to send
fullURI - if false then try to change header.uri into just the file
sender - the listener that will be notified when the header has been sent (or sending has failed
Throws:
IOException - if the header can not be converted to network data
Method Detail

sendHeader

public void sendHeader()
Send the header


timeout

public void timeout()
Description copied from interface: AsyncListener
The operation timed out

Specified by:
timeout in interface AsyncListener

failed

public void failed(Exception cause)
Description copied from interface: AsyncListener
Reading failed

Specified by:
failed in interface AsyncListener
Parameters:
cause - the real reason the operation failed.

blockSent

public void blockSent()
Description copied from interface: BlockSentListener
The http header has been sent.

Specified by:
blockSent in interface BlockSentListener