All Packages  This Package  Class Hierarchy  Class Search  Index

Class edu.utah.janos.ants.route.DynamicRouteEvents
java.lang.Object
   |
   +----edu.utah.janos.ants.route.DynamicRouteEvents

  Summary

class  DynamicRouteEvents
     extends java.lang.Object
{
          // Fields 9
     private static final int EXPIREINTERVAL;
     private static final int GCINTERVAL;
     private static final long RCRESOLUTION;
     private static final int SECONDS;
     private static final int TRIGGERINTERVAL;
     private static final int TRIGGERSPREAD;
     private static final int UPDATEINTERVAL;
     private static final int UPDATESPREAD;
     private final Vector events;

          // Constructors 1
     DynamicRouteEvents();

          // Methods 12
     static long eventTime(long, long, long);

     public void clearExpireTimer(long);
     public void clearGCTimer(long);
     public void clearTimer(DynamicRouteEvent);
     public DynamicRouteEvent findFirstTimer();
     DynamicRouteEvent findTimer(long);
     boolean isEmpty();
     public void setExpireTimer(DynamicRouteEntry, long);
     public void setGCTimer(DynamicRouteEntry, long);
     public void setPeriodicTimer(long);
     public DynamicRouteEvent setTimer(long, int);
     public void setTriggerTimer(long);
}

Event queue for the dynamic route table. Also contains all of the timeout-related constants.




  Fields

· RCRESOLUTION

Summary  |  Top

   private static final long RCRESOLUTION

eventTime() rounds all timers to this granularity (in milliseconds).

See Also: eventTime


· SECONDS

Summary  |  Top
   private static final int SECONDS


· EXPIREINTERVAL

Summary  |  Top
   private static final int EXPIREINTERVAL


· GCINTERVAL

Summary  |  Top
   private static final int GCINTERVAL


· UPDATEINTERVAL

Summary  |  Top
   private static final int UPDATEINTERVAL


· UPDATESPREAD

Summary  |  Top
   private static final int UPDATESPREAD


· TRIGGERINTERVAL

Summary  |  Top
   private static final int TRIGGERINTERVAL


· TRIGGERSPREAD

Summary  |  Top
   private static final int TRIGGERSPREAD


· events

Summary  |  Top
   private final Vector events

Store of timer events. Each event is a DynamicRouteEvent. Not sorted or in any particular order (probably never long enough to justify). There is exactly one event set to expire for any given time.

Used for expire, GC and periodic timers.

See Also: findTimer, findFirstTimer, setTimer, clearTimer


  Constructors

· DynamicRouteEvents

Summary  |  Top

   DynamicRouteEvents() 


  Methods

· isEmpty

Summary  |  Top
   boolean isEmpty() 


· eventTime

Summary  |  Top
   static long eventTime(long base, 
                         long add, 
                         long spread) 

Compute a route event clock time. All returned times are snapped to granularity of RCRESOLUTION.

Parameter Description
base Generally 'now'.
add offset to add to base
spread for randomizing the time a bit.



· findTimer

Summary  |  Top
   DynamicRouteEvent findTimer(long when) 

Find a DynamicRouteEvent set to go off at "when".

Finds the first such event.

There is only ever be one (or zero) DynamicRouteEvent in the queue with a timer that matches when.



· findFirstTimer

Summary  |  Top
   public DynamicRouteEvent findFirstTimer() 

Find the event in the timer queue with the shortest timer.



· setTimer

Summary  |  Top
   public DynamicRouteEvent setTimer(long when, 
                                     int type) 

Add a new timer to the event queue.

Reuses existing timers if one is set to go off at the same time.



· clearTimer

Summary  |  Top
   public void clearTimer(DynamicRouteEvent r) 

Remove the given DynamicRouteEvent from the list.

Parameter Description
r the event to remove



· setExpireTimer

Summary  |  Top
   public void setExpireTimer(DynamicRouteEntry r, 
                              long now) 

Add a expire timer to go off after a constant EXPIREINTERVAL. XXX can see RouteEntry.

See Also: EXPIREINTERVAL



· clearExpireTimer

Summary  |  Top
   public void clearExpireTimer(long when) 

Clear a expire timer from the event queue. The event found at 'when' had best be a expire event with a non-zero expire count, thank you very much.

Parameter Description
when when the timer was scheduled to go off.



· setGCTimer

Summary  |  Top
   public void setGCTimer(DynamicRouteEntry route, 
                          long now) 

Add a GC timer to go off a constant GCINTERVAL from now. Update the given route to 'expire' at that time. XXX can see RouteEntry.



· clearGCTimer

Summary  |  Top
   public void clearGCTimer(long when) 

Clear a GC timer from the event queue. There had best be a GC timer at moment when.



· setPeriodicTimer

Summary  |  Top
   public void setPeriodicTimer(long now) 

Add a periodic timer to go off at UPDATEINTERVAL +/- UPDATESPREAD millis after 'now'.

See Also: UPDATESPREAD, UPDATEINTERVAL



· setTriggerTimer

Summary  |  Top
   public void setTriggerTimer(long base) 

Add a trigger timer to go off at TRIGGERINTERVAL +/- TRIGGERSPREAD millis after 'base'.

Sets the 'trigger' member to true.

See Also: TRIGGERINTERVAL, TRIGGERSPREAD



All Packages  This Package  Class Hierarchy  Class Search  Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7