|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrice.pastry.wire.DatagramTransmissionManager
Class which controls which object should be transmitted in the UPD version of the pastry protocol. This class is responsible for ensuring reliable and ordered delivery of packets to their destinations. This implementation is thread-safe, so both the client and pastry thread can access it at once.
Field Summary | |
static int |
BEGIN_ACK_NUM
the first 'ack' number to use |
Constructor Summary | |
DatagramTransmissionManager(WirePastryNode spn,
java.nio.channels.SelectionKey key,
DatagramManager dm)
Builds a transmission manager for a given pastry node using a given key. |
Method Summary | |
void |
add(PendingWrite write)
Adds a pending write to the queue. |
void |
enableWrite(boolean write,
java.lang.String reason)
This method controls the key's write interestOp, and has a parallel boolean to improve performance. |
java.util.Iterator |
getReady()
Returns an iterator over the pending writes ready to be written. |
void |
notifyKilled()
notifys all of the TransmissionEntries that they have been killed. |
void |
receivedAck(AcknowledgementMessage message)
Callback mechanism designed to be called when an ack packet is received. |
void |
resetAckNumber(NodeId node)
Resets the sequence number for the specified node |
void |
wakeup()
Designed to be called periodically in order for the Transmission Manager to decide if a packet has been lost. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static int BEGIN_ACK_NUM
Constructor Detail |
public DatagramTransmissionManager(WirePastryNode spn, java.nio.channels.SelectionKey key, DatagramManager dm)
spn
- The pastry node this manager serves.key
- The key used by the datagram manager.Method Detail |
public java.util.Iterator getReady()
public void notifyKilled()
public void add(PendingWrite write)
write
- The pending write to add.public void receivedAck(AcknowledgementMessage message)
message
- The ack that was received.public void wakeup()
public void enableWrite(boolean write, java.lang.String reason)
write
- new boolean for key's write interestOpreason
- used for logging, the reason the state
is changingpublic void resetAckNumber(NodeId node)
node
- The node to reset
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |