org.objectweb.jonas_timer
Class TimerEvent

java.lang.Object
  extended by org.objectweb.jonas_timer.TimerEvent

public class TimerEvent
extends java.lang.Object


Constructor Summary
TimerEvent(TimerEventListener l, long timeout, java.lang.Object a, boolean p)
          Constructor
 
Method Summary
 void change(long timeout, java.lang.Object a)
          Change the Timer value
 long getRemaining()
           
 boolean ispermanent()
          Is this timer permanent ?
 boolean isStopped()
          Is this timer stopped ?
 void process()
          Process the Timer
 long restart()
          Restart timer to its initial value
 void stop()
          stop the timer, but keep it for further reuse (See change())
 void unset()
          Unvalidate the timer.
 long update()
          Update timer every second.
 boolean valid()
          Is this timer valid ?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimerEvent

public TimerEvent(TimerEventListener l,
                  long timeout,
                  java.lang.Object a,
                  boolean p)
Constructor

Parameters:
l - Object that will be notified when the timer expire.
timeout - nb of milliseconds before the timer expires.
a - info passed with the timer
p - true if the timer is permanent.
Method Detail

update

public long update()
Update timer every second. Used by clock. - this must be called with the timerList monitor.

Parameters:
ms - clock period

restart

public long restart()
Restart timer to its initial value


process

public void process()
Process the Timer


change

public void change(long timeout,
                   java.lang.Object a)
Change the Timer value

Parameters:
timeout - in milliseconds

unset

public void unset()
Unvalidate the timer. It will be removed by the timer manager.


stop

public void stop()
stop the timer, but keep it for further reuse (See change())


valid

public boolean valid()
Is this timer valid ?


ispermanent

public boolean ispermanent()
Is this timer permanent ?


isStopped

public boolean isStopped()
Is this timer stopped ?


getRemaining

public long getRemaining()
Returns:
remaining time in millisec