com.caucho.resources
Class TimerTrigger

java.lang.Object
  extended by com.caucho.resources.TimerTrigger
All Implemented Interfaces:
Trigger

public class TimerTrigger
extends java.lang.Object
implements Trigger

Trigger for delay, period


Constructor Summary
TimerTrigger()
          Constructs a new timer trigger.
TimerTrigger(long firstTime)
          Creates a timer trigger.
TimerTrigger(long firstTime, long period)
          Creates a timer trigger.
 
Method Summary
 long getFirstTime()
           
 long getPeriod()
           
 long nextTime(long now)
          Returns the time of the next trigger event
 void setFirstTime(long firstTime)
           
 void setPeriod(long period)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TimerTrigger

public TimerTrigger()
Constructs a new timer trigger.


TimerTrigger

public TimerTrigger(long firstTime)
Creates a timer trigger.

Parameters:
firstTime - The first time the trigger should fire, in milliseconds.

TimerTrigger

public TimerTrigger(long firstTime,
                    long period)
Creates a timer trigger.

Parameters:
firstTime - The first time the trigger should fire, in milliseconds.
period - The interval, in milliseconds, the timer should be triggered.
Method Detail

setFirstTime

public void setFirstTime(long firstTime)

getFirstTime

public long getFirstTime()

setPeriod

public void setPeriod(long period)

getPeriod

public long getPeriod()

nextTime

public long nextTime(long now)
Returns the time of the next trigger event

Specified by:
nextTime in interface Trigger
Parameters:
now - The current time.
Returns:
The next trigger time.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object