com.eventgnosis.util
Class PassiveTimer

java.lang.Object
  extended bycom.eventgnosis.util.PassiveTimer

public class PassiveTimer
extends java.lang.Object

Implements passive timer functionality.
Passive means that it waits for clients to call to see if the interval has expired.
Initial value of zero (0) means never expire.


Constructor Summary
PassiveTimer(long interval)
          Creates a new instance of PassiveTimer.
 
Method Summary
 long getInterval()
          Get timer expiration interval.
 java.lang.String getRuntimeXml()
           
 long getStartTime()
          Get time of the last reset, in milliseconds.
The PassiveTimer is also reset at initialization.
 long getTimeNow()
           
 boolean isExpired()
           
 long msecsRemaining()
           
 void reset()
          Resets timer.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PassiveTimer

public PassiveTimer(long interval)
Creates a new instance of PassiveTimer.

Parameters:
interval - - timer expiration time in milliseconds.
Method Detail

getInterval

public long getInterval()
Get timer expiration interval.

Returns:
long - expiration interval.

getRuntimeXml

public java.lang.String getRuntimeXml()
Returns:
built XML relating to runtime

getStartTime

public long getStartTime()
Get time of the last reset, in milliseconds.
The PassiveTimer is also reset at initialization.

Returns:
time of the last reset, in milliseconds.

getTimeNow

public long getTimeNow()
Returns:
long - current system time in milliseconds.

isExpired

public boolean isExpired()
Returns:
true if interval is expired; false otherwise

msecsRemaining

public long msecsRemaining()
Returns:
long - milliseconds remaining of the interval expiration.

reset

public void reset()
Resets timer.


toString

public java.lang.String toString()