org.locomotive.util.cache
Class AlarmThread

java.lang.Object
  |
  +--org.locomotive.util.cache.AlarmThread

public abstract class AlarmThread
extends java.lang.Object
implements java.lang.Runnable


Field Summary
 int MAXIMUM_NUMBER_OF_ENTRIES
           
 int SECONDS_IN_PERIOD
           
 int WAKE_UP_INTERVAL
           
 
Constructor Summary
AlarmThread(int number_of_seconds_in_period, int wake_up_interval, int maximum_number_of_entries)
           
 
Method Summary
 void print(java.lang.String string)
           
 void run()
          The run() method only takes care of sleeping and waking up.
 void shutdown()
          Allows you to stop this thread gracefully, without forcing it to die a violent death.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SECONDS_IN_PERIOD

public int SECONDS_IN_PERIOD

WAKE_UP_INTERVAL

public int WAKE_UP_INTERVAL

MAXIMUM_NUMBER_OF_ENTRIES

public int MAXIMUM_NUMBER_OF_ENTRIES
Constructor Detail

AlarmThread

public AlarmThread(int number_of_seconds_in_period,
                   int wake_up_interval,
                   int maximum_number_of_entries)
Parameters:
number_of_seconds_in_period - your alarm events must trigger within a certain maximum duration of time. This parameter expresses that time as a number of seconds.
wake_up_interval - how often this AlarmThread should wake up and check for alarm events which have triggered.
maximum_number_of_entries - if you want to restrict the capacity for the total number of alarm events, set this parameter to that number. if you do not want to restrict the capacity, set this parameter to 0.
Method Detail

run

public void run()
The run() method only takes care of sleeping and waking up.
Specified by:
run in interface java.lang.Runnable

shutdown

public void shutdown()
Allows you to stop this thread gracefully, without forcing it to die a violent death.

print

public void print(java.lang.String string)