|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrice.pastry.wire.SocketChannelReader
Class which serves as an "reader" for messages sent across the wire via the Pastry socket protocol. This class builds up an object as it is being sent across the wire, and when it has recieved all of an object, it informs the WirePastryNode by using the recieveMessage(msg) method. The SocketChannelReader is designed to be reused, to read objects continiously off of one stream.
Field Summary | |
protected WireNodeHandle |
handle
|
protected static byte[] |
MAGIC_NUMBER
the magic number array which is written first |
Constructor Summary | |
SocketChannelReader(WirePastryNode spn,
WireNodeHandle _handle)
Constructor which creates this SocketChannelReader and the WirePastryNode. |
Method Summary | |
java.lang.Object |
read(java.nio.channels.SocketChannel sc)
Method which is to be called when there is data available on the specified SocketChannel. |
void |
reset()
Resets this input stream so that it is ready to read another object off of the queue. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected WireNodeHandle handle
protected static byte[] MAGIC_NUMBER
Constructor Detail |
public SocketChannelReader(WirePastryNode spn, WireNodeHandle _handle)
spn
- The PastryNode the SocketChannelReader serves.Method Detail |
public java.lang.Object read(java.nio.channels.SocketChannel sc) throws java.io.IOException
sc
- The channel to read from.
java.io.IOException
- if there is an error during reading/deserializationpublic void reset()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |