com.distributed.api
Class Timer

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--com.distributed.api.Timer
All Implemented Interfaces:
java.lang.Runnable

public class Timer
extends java.lang.Thread

Class to Implement Timer, used for consensus


Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Timer()
          Default Constructor
 
Method Summary
 void run()
          Method to start the Timer
 void scheduleTask(TimerTask t, long delay)
          Method to Schedule a task
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Timer

public Timer()
Default Constructor

Method Detail

run

public void run()
Method to start the Timer

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

scheduleTask

public void scheduleTask(TimerTask t,
                         long delay)
Method to Schedule a task

Parameters:
t - Timer Task to be scheduled
delay - Delay period