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

Variable Index

 o ACK_POOL_SIZE
initial pool size
 o AckPool
pool of unused Ack packets
 o EventMgr
 o NodesTable
 o outQ
 o Ports
table of ports on which acks are sent/received
 o PortThreadsTbl
 o SeqNumsTbl
 o TIMEOUT_PERIOD
default timeout period for re-transmission

Constructor Index

 o AckManager(Hashtable)
constructor

Method Index

 o confirmPacket(String, int, String)
interface for Acknowledgement packet to send receipt to corresponding port thread.
 o getAckPacket()
returns the next available Ack packet increases pool size if all exhausted
 o getNextSequenceNumber(String, String)
returns the next sequence number for the type
 o queueForTransmission(String, ReliableCommFW)
enqueue packets in appropriate port bucket
 o run()

Variables

 o Ports
 static Hashtable Ports
table of ports on which acks are sent/received

 o NodesTable
 static Hashtable NodesTable
 o PortThreadsTbl
 static Hashtable PortThreadsTbl
 o SeqNumsTbl
 static Hashtable SeqNumsTbl
 o outQ
 static Queue outQ
 o TIMEOUT_PERIOD
 static final int TIMEOUT_PERIOD
default timeout period for re-transmission

 o AckPool
 static UnsynchVector AckPool
pool of unused Ack packets

 o ACK_POOL_SIZE
 static int ACK_POOL_SIZE
initial pool size

 o EventMgr
 static EventManager EventMgr

Constructors

 o AckManager
 public AckManager(Hashtable NodesTable)
constructor

Parameters:
NodesTable - table of neighboring nodes

Methods

 o getAckPacket
 public static synchronized Acknowledgement getAckPacket()
returns the next available Ack packet increases pool size if all exhausted

 o 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
 o 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
 o run
 public void run()
 o 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
1