All Packages Class Hierarchy This Package Previous Next Index
Class magician.Node.AckManager
java.lang.Object
|
+----magician.Node.AckManager
- public class AckManager
- extends Object
- implements Runnable, PerfConstants
Acknowledgement manager. It maintains the outgoing ports and the sequence
numbering on a per-port, per-type basis. This enables Smartpackets to put
in their own acknowledgement and sequencing schemes
Starts an port thread for each outgoing port. Each thread has its own
waiting queue.
- See Also:
- PortThread, StopAndWaitAck, ReliableCommFW
-
ACK_POOL_SIZE
- initial pool size
-
AckPool
- pool of unused Ack packets
-
EventMgr
-
-
NodesTable
-
-
outQ
-
-
Ports
- table of ports on which acks are sent/received
-
PortThreadsTbl
-
-
SeqNumsTbl
-
-
TIMEOUT_PERIOD
- default timeout period for re-transmission
-
AckManager(Hashtable)
- constructor
-
confirmPacket(String, int, String)
- interface for Acknowledgement packet to send receipt to corresponding port
thread.
-
getAckPacket()
- returns the next available Ack packet
increases pool size if all exhausted
-
getNextSequenceNumber(String, String)
- returns the next sequence number for the type
-
queueForTransmission(String, ReliableCommFW)
- enqueue packets in appropriate port bucket
-
run()
-
Ports
static Hashtable Ports
- table of ports on which acks are sent/received
NodesTable
static Hashtable NodesTable
PortThreadsTbl
static Hashtable PortThreadsTbl
SeqNumsTbl
static Hashtable SeqNumsTbl
outQ
static Queue outQ
TIMEOUT_PERIOD
static final int TIMEOUT_PERIOD
- default timeout period for re-transmission
AckPool
static UnsynchVector AckPool
- pool of unused Ack packets
ACK_POOL_SIZE
static int ACK_POOL_SIZE
- initial pool size
EventMgr
static EventManager EventMgr
AckManager
public AckManager(Hashtable NodesTable)
- constructor
- Parameters:
- NodesTable - table of neighboring nodes
getAckPacket
public static synchronized Acknowledgement getAckPacket()
- returns the next available Ack packet
increases pool size if all exhausted
getNextSequenceNumber
public static int getNextSequenceNumber(String PortName,
String typeId)
- returns the next sequence number for the type
- Parameters:
- typeId - the SmartPacket type
- Returns:
- the next sequence number
queueForTransmission
public static synchronized void queueForTransmission(String port,
ReliableCommFW SPObject) throws NoRouteToHostException
- enqueue packets in appropriate port bucket
- Parameters:
- port - name of neighboring active node
- SPObject - the SmartPacket object
- seqNo - the sequence number for this packet
- timeout - the retransmission timeout
run
public void run()
confirmPacket
public static void confirmPacket(String port,
int seqNo,
String typeId) throws IndexOutOfBoundsException
- interface for Acknowledgement packet to send receipt to corresponding port
thread.
- Parameters:
- port - name of active node associated with the port thread
- seqNo - the sequence number being acknowledged
- typeId - the type identifier of the Smartpacket
- Throws: IndexOutOfBoundsException
- if sequence number is out of order.
All Packages Class Hierarchy This Package Previous Next Index