org.apache.avalon.cornerstone.services.scheduler
Class CronTimeTrigger
java.lang.Object
org.apache.avalon.cornerstone.services.scheduler.CronTimeTrigger
- All Implemented Interfaces:
- TimeTrigger, Trigger
- public class CronTimeTrigger
- extends java.lang.Object
- implements TimeTrigger
This is the holder triggers based on standard crontabs format.
- Author:
- Avalon Development Team
Constructor Summary |
CronTimeTrigger(int minute,
int hour,
int day,
int month,
int year,
boolean isDayOfWeek)
Constructor for CronTimeTrigger. |
Method Summary |
long |
getTimeAfter(long moment)
Returns the next time after the given moment when
this trigger goes off. |
void |
reset()
Reset the cron-trigger. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
m_minute
protected final int m_minute
m_hour
protected final int m_hour
m_dayOfMonth
protected final int m_dayOfMonth
m_month
protected final int m_month
m_dayOfWeek
protected final int m_dayOfWeek
m_year
protected final int m_year
CronTimeTrigger
public CronTimeTrigger(int minute,
int hour,
int day,
int month,
int year,
boolean isDayOfWeek)
- Constructor for CronTimeTrigger.
Day is either day of week or day of month depending on value of isDayOfWeek.
if (isDayOfWeek == true) then valid values are 1-7 otherwise the values
are 1-31
- Parameters:
minute
- the minute at which job is scheduled. (0-59)hour
- hour at which job is scheduled. (0-23 or -1 for every hour)month
- the month at which job is scheduled. (0-11 or -1 for every month)year
- the year when job is scheduled (-1 implies every year)day
- the dayisDayOfWeek
- true if day is a day of week or false if day is day of month
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
reset
public void reset()
- Reset the cron-trigger.
- Specified by:
reset
in interface Trigger
toString
public java.lang.String toString()
Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.