org.apache.avalon.cornerstone.services.scheduler
Class PeriodicTimeTrigger
java.lang.Object
org.apache.avalon.cornerstone.services.scheduler.PeriodicTimeTrigger
- All Implemented Interfaces:
- TimeTrigger, Trigger
- public class PeriodicTimeTrigger
- extends java.lang.Object
- implements TimeTrigger
Goes off every period milliseconds after waiting for
offset milliseconds from the moment the trigger was
reset.
- Author:
- Avalon Development Team
Method Summary |
long |
getOffset()
|
long |
getPeriod()
|
long |
getTimeAfter(long moment)
Returns the next time after the given moment when
this trigger goes off. |
void |
reset()
Reset the original TimeTrigger. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
m_offset
protected final long m_offset
m_period
protected final long m_period
PeriodicTimeTrigger
public PeriodicTimeTrigger(int offset,
int period)
- Creates a periodic trigger. It goes off the first time after
offset milliseconds from the time it was
reset and then every period
milliseconds. The trigger is reset as
part of its construction.
- Parameters:
offset
- initial delay in milliseconds, -1 means fire immediatelyperiod
- after initial delay in milliseconds, -1 means fire only once after initial delay
getTimeAfter
public long getTimeAfter(long moment)
- Returns the next time after the given moment when
this trigger goes off.
- Specified by:
getTimeAfter
in interface TimeTrigger
- Parameters:
moment
- base point in milliseconds
- Returns:
- the time in milliseconds when this trigger goes off
getOffset
public long getOffset()
getPeriod
public long getPeriod()
reset
public void reset()
- Reset the original TimeTrigger.
This will recalculate the activation time for this trigger.
- Specified by:
reset
in interface Trigger
toString
public java.lang.String toString()
Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.