|
Rice Pastry API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object rice.pastry.socket.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 Environment |
environment
DESCRIBE THE FIELD |
protected Logger |
logger
DESCRIBE THE FIELD |
protected SourceRoute |
path
DESCRIBE THE FIELD |
Constructor Summary | |
SocketChannelReader(Environment env,
SourceRoute path)
Constructor for SocketChannelReader. |
|
SocketChannelReader(SocketPastryNode spn,
SourceRoute path)
Constructor which creates this SocketChannelReader and the WirePastryNode. |
Method Summary | |
SocketBuffer |
read(java.nio.channels.SocketChannel sc)
Method which is to be called when there is data available on the specified SocketChannel. |
protected void |
record(java.lang.Object obj,
int size,
SourceRoute path)
DESCRIBE THE METHOD |
void |
reset()
Resets this input stream so that it is ready to read another object off of the queue. |
protected void |
setPath(SourceRoute path)
Sets this reader's path |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected SourceRoute path
protected Environment environment
protected Logger logger
Constructor Detail |
public SocketChannelReader(SocketPastryNode spn, SourceRoute path)
spn
- The PastryNode the SocketChannelReader serves.path
- DESCRIBE THE PARAMETERpublic SocketChannelReader(Environment env, SourceRoute path)
env
- DESCRIBE THE PARAMETERpath
- DESCRIBE THE PARAMETERMethod Detail |
protected void setPath(SourceRoute path)
path
- The path this reader is usingpublic SocketBuffer read(java.nio.channels.SocketChannel sc) throws java.io.IOException
sc
- The channel to read from.
java.io.IOException
- DESCRIBE THE EXCEPTIONprotected void record(java.lang.Object obj, int size, SourceRoute path)
obj
- DESCRIBE THE PARAMETERsize
- DESCRIBE THE PARAMETERpath
- DESCRIBE THE PARAMETERpublic void reset()
|
Rice Pastry API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |