juju.reattore.server.http
Class HttpClientHandler

java.lang.Object
  |
  +--juju.reattore.server.http.HttpClientHandler
All Implemented Interfaces:
ClientSocketHandler, Handler

public class HttpClientHandler
extends java.lang.Object
implements ClientSocketHandler

Handler that knows about the HTTP protocol.


Constructor Summary
HttpClientHandler(java.nio.channels.SocketChannel ch, HttpMediator mediator)
          Create a new HTTP handler.
 
Method Summary
 int getInterestOps()
          Returns the set of operations this handler is currently interested in.
 boolean handleConnected()
          Called when the socket is initially connected.
 void handleError()
          Called when any error occurs on the attached socket.
 boolean handleReadable()
          Called when the attached socket has data available.
 boolean handleWritable()
          Called when the attached socket is ready to be written to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpClientHandler

public HttpClientHandler(java.nio.channels.SocketChannel ch,
                         HttpMediator mediator)
Create a new HTTP handler.

Parameters:
ch - The socket to read and write on
mediator - The mediator to use for any side information.
Method Detail

getInterestOps

public int getInterestOps()
Description copied from interface: Handler
Returns the set of operations this handler is currently interested in. See SelectorKey for more informration.

Specified by:
getInterestOps in interface Handler
Returns:
Bitvect of SelectorKey.OP_*
See Also:
Handler

handleConnected

public boolean handleConnected()
                        throws java.io.IOException
Description copied from interface: ClientSocketHandler
Called when the socket is initially connected. This does not imply that the channel is readable or writable.

Specified by:
handleConnected in interface ClientSocketHandler
Returns:
true if processing has finished and this socket should be closed.
Throws:
java.io.IOException - if a fatal IO error occurred.
See Also:
ClientSocketHandler

handleReadable

public boolean handleReadable()
                       throws java.io.IOException
Description copied from interface: ClientSocketHandler
Called when the attached socket has data available.

Specified by:
handleReadable in interface ClientSocketHandler
Returns:
true if processing has finished and this socket should be closed.
Throws:
java.io.IOException - if a fatal IO error occurred.
See Also:
ClientSocketHandler

handleWritable

public boolean handleWritable()
                       throws java.io.IOException
Description copied from interface: ClientSocketHandler
Called when the attached socket is ready to be written to.

Specified by:
handleWritable in interface ClientSocketHandler
Returns:
true if processing has finished and this socket should be closed.
Throws:
java.io.IOException - if a fatal IO error occurred.
See Also:
ClientSocketHandler

handleError

public void handleError()
Description copied from interface: ClientSocketHandler
Called when any error occurs on the attached socket. Does not distinguish between connection, transient, or fatal errors. The socket may not be usable.

Specified by:
handleError in interface ClientSocketHandler
See Also:
ClientSocketHandler


Copyright © 2002-2003 Michael Hope. All Rights Reserved.