Rice Pastry API

rice.pastry.wire
Interface SelectionKeyHandler

All Known Implementing Classes:
DatagramManager, SocketManager, WireNodeHandle

public interface SelectionKeyHandler

This interface is designed to be a callback mechanism from the SelectorManager. Once the manager has determines that something has happened, it informs the appropriate SelectionKeyHandler via this interface. The SelectionKeyHandler which is interested in being notified of events relating to the SelectionKey should attach itself to the SelectionKey via the attach() method. The SelectorManager will then call that SelectionKeyHandler's methods.

Version:
$Id: SelectionKeyHandler.java,v 1.1 2002/08/13 18:09:55 amislove Exp $
Author:
Alan Mislove

Method Summary
 void accept(java.nio.channels.SelectionKey key)
          Method which is called when the key becomes acceptable.
 void connect(java.nio.channels.SelectionKey key)
          Method which is called when the key becomes connectable.
 void read(java.nio.channels.SelectionKey key)
          Method which is called when the key becomes readable.
 void wakeup()
          Method which is called when every time the SelectorManager is woken up.
 void write(java.nio.channels.SelectionKey key)
          Method which is called when the key becomes writable.
 

Method Detail

accept

public void accept(java.nio.channels.SelectionKey key)
Method which is called when the key becomes acceptable.

Parameters:
key - The key which is acceptable.

connect

public void connect(java.nio.channels.SelectionKey key)
Method which is called when the key becomes connectable.

Parameters:
key - The key which is connectable.

read

public void read(java.nio.channels.SelectionKey key)
Method which is called when the key becomes readable.

Parameters:
key - The key which is readable.

write

public void write(java.nio.channels.SelectionKey key)
Method which is called when the key becomes writable.

Parameters:
key - The key which is writable.

wakeup

public void wakeup()
Method which is called when every time the SelectorManager is woken up. It allows SelectionKeyHandlers to check for lost packets, etc...


Rice Pastry API

Copyright © 2001 - Rice Pastry.


Imprint-Dataprotection