Project JXTA

net.jxta.impl.util
Class JxtaTimer

java.lang.Object
  |
  +--net.jxta.impl.util.JxtaTimer

public class JxtaTimer
extends java.lang.Object
implements java.lang.Runnable

This class implements a simple timer utility. Note that this class is provided only because java.util.Timer was introduced in Java 1.3, and Jxta implementation must be able to run on older Java version (1.1.4).

Since:
JXTA 1.0
See Also:
net.jxta.util.JxtaTimerHandler

Constructor Summary
JxtaTimer(JxtaTimerHandler handler, long delay, boolean repeat)
          Timer constructor
 
Method Summary
 void cancel()
          cancel a pending timer.
 void run()
          run method to start the thread timer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JxtaTimer

public JxtaTimer(JxtaTimerHandler handler,
                 long delay,
                 boolean repeat)
Timer constructor
Parameters:
handler - is a handler invoked when the timer goes off
delay - is the delay in milliseconds before the timer goes off
repeat - is set to false if the timer is supposes to go off only once and then die, or set to true if the timer is supposed to go off several time until it is cancelled.
Since:
JXTA 1.0
Method Detail

cancel

public void cancel()
cancel a pending timer. The timer is destroyed, and the handler is not called.
Since:
JXTA 1.0

run

public void run()
run method to start the thread timer
Specified by:
run in interface java.lang.Runnable
Since:
JXTA 1.0

Project JXTA