Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.sip
Class TimerScheduler

java.lang.Object
  extended by net.java.sip.communicator.impl.protocol.sip.TimerScheduler

public class TimerScheduler
extends Object

Represents an analogy of Timer which does not have the disadvantage of Timer to always create its thread at construction time. It also allows the currently scheduled TimerTasks to be canceled while still being able to schedule new TimerTasks later on.

Author:
Lubomir Marinov

Constructor Summary
TimerScheduler()
           
 
Method Summary
 void cancel()
          Discarding any currently scheduled TimerTasks.
 void schedule(TimerTask task, long delay)
          Schedules the specified TimerTask for execution after the specified delay.
 void schedule(TimerTask task, long delay, long period)
          Schedules the specified TimerTask for repeated fixed-delay execution, beginning after the specified delay.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimerScheduler

public TimerScheduler()
Method Detail

cancel

public void cancel()
Discarding any currently scheduled TimerTasks.


schedule

public void schedule(TimerTask task,
                     long delay)
Schedules the specified TimerTask for execution after the specified delay.

Parameters:
task - the TimerTask to be executed after the specified delay
delay - the delay in milliseconds before the specified TimerTask is executed

schedule

public void schedule(TimerTask task,
                     long delay,
                     long period)
Schedules the specified TimerTask for repeated fixed-delay execution, beginning after the specified delay. Subsequent executions take place at approximately regular intervals separated by the specified period.

Parameters:
task - the TimerTask to be scheduled
delay - the delay in milliseconds before the specified TimerTask is executed
period - the time in milliseconds between successive executions of the specified TimerTask

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.