|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jcorporate.expresso.services.crontab.CrontabEntry
CrontabEntry represents a repeatable 'action' that can take place at a given date and time.
A crontab entry's sort order creates differences between Comparable and equals(). the objects are compared by the execution time. They are tested for equality by testing time AND the listeners
| Field Summary | |
protected long |
alarmTime
When is the next time for the alarm |
protected static Object |
counterLock
|
protected long |
counterValue
Unique id for sorting. |
protected int |
dayOfMonth
day of month for the crontab |
protected int |
dayOfWeek
day of week for the crontab |
protected static long |
globalCounter
|
protected int |
hour
Hours for the crontab |
protected boolean |
isRelative
Is the crontab a 'relative' time? |
protected boolean |
isRepetitive
Is the crontab a repetitive job |
protected String |
jobNumber
Job Number for this CrontabEntry's associated JobQueue entry |
protected String |
label
Label for the crontab |
protected CrontabListenerI |
listener
The listener of the crontab |
protected int |
minute
The minutes for the crontab |
protected int |
month
month for the crontab |
static int |
TIME_UNUSED
Constant that represents a 'time' value that is unused. |
protected int |
year
year for the crontab |
| Constructor Summary | |
CrontabEntry(Date date,
CrontabListenerI listener)
Constructs a Crontab Entry class. |
|
CrontabEntry(int delay,
boolean isRepetitive,
CrontabListenerI listener)
Construct a new crontab entry with a given delay |
|
CrontabEntry(int minute,
int hour,
int dayOfMonth,
int month,
int dayOfWeek,
int year,
CrontabListenerI listener)
Construct a Crontab entry. |
|
CrontabEntry(int minute,
int hour,
int dayOfMonth,
int month,
int dayOfWeek,
int year,
String jobLabel,
CrontabListenerI listener)
Construct a Crontab entry. |
|
| Method Summary | |
protected void |
adjustExecutionTime(Calendar now,
Calendar alarm)
Adjusts the execution time so that the next execution time is proper ie.. all cron rules should be followed and the next cron execution should be greater than now. |
int |
compareTo(Object obj)
Standard comparison operator. |
boolean |
equals(Object obj)
Returns true if the two alarm times of the comparing crontab entries are equal. |
long |
getAlarmTime()
Get the alarm time in system time. |
long |
getCounter()
Retrieve an incrementing id value unique across crontab instances |
int |
getDayOfMonth()
Retrieve the day of month setting |
int |
getDayOfWeek()
Return day of week setting |
int |
getHour()
Retrieve hour setting |
String |
getJobNumber()
Return Job Number for this CrontabEntry's associated JobQueue entry |
String |
getLabel()
Retrieve the label of the entry |
CrontabListenerI |
getListener()
Retrieve the listener for the crontab. |
int |
getMinute()
Retrieve the minutes of the entry |
int |
getMonth()
Return the month value of the entry |
int |
getYear()
Return the year value of the entry |
boolean |
isIsRelative()
Return isRelative value |
boolean |
isIsRepetitive()
Retrieve the isRepetitive value |
protected void |
setCounterValue()
Sets the counter so that order is guaranteed |
void |
setJobNumber(String s)
Set Job Number for this CrontabEntry's associated JobQueue entry |
String |
toString()
Returns the class as a string. |
void |
updateEntryTime()
Set the new/latest time. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int TIME_UNUSED
protected static long globalCounter
protected static Object counterLock
protected transient CrontabListenerI listener
protected String label
protected boolean isRelative
protected boolean isRepetitive
protected int dayOfMonth
protected int dayOfWeek
protected int hour
protected int minute
protected int month
protected int year
protected long alarmTime
protected long counterValue
protected String jobNumber
| Constructor Detail |
public CrontabEntry(Date date,
CrontabListenerI listener)
throws CronException
date - The date to execute the crontab listenerlistener - The class to execute when the alarm 'rings'
CronException - upon error
public CrontabEntry(int delay,
boolean isRepetitive,
CrontabListenerI listener)
delay - the job until the number of minutes in the next hourisRepetitive - set if the job should be executed every X amount of
timelistener - the interface to notify when the cron 'rings'
IllegalArgumentException - if the delay is less than 1
public CrontabEntry(int minute,
int hour,
int dayOfMonth,
int month,
int dayOfWeek,
int year,
CrontabListenerI listener)
throws CronException
minute - Minute of the hour to executehour - Hour of the day to executedayOfMonth - The day of the month to executemonth - The month of the year to executedayOfWeek - The day of the week to executeyear - to execute OR TIME_UNUSED if this is a repetative crontab
entrylistener - The class that gets called when the crontab 'rings'
CronException - upon error
public CrontabEntry(int minute,
int hour,
int dayOfMonth,
int month,
int dayOfWeek,
int year,
String jobLabel,
CrontabListenerI listener)
throws CronException
minute - Minute of the hour to executehour - Hour of the day to executedayOfMonth - The day of the month to executemonth - The month of the year to executedayOfWeek - The day of the week to executeyear - to execute OR TIME_UNUSED if this is a repetative crontab
entryjobLabel - - The label of the crontab entry.listener - The class that gets called when the crontab 'rings'
CronException - upon error| Method Detail |
public long getAlarmTime()
public long getCounter()
public int getDayOfMonth()
public int getDayOfWeek()
public int getHour()
public boolean isIsRelative()
public boolean isIsRepetitive()
public String getLabel()
public CrontabListenerI getListener()
public int getMinute()
public int getMonth()
public int getYear()
public int compareTo(Object obj)
compareTo in interface Comparableobj - The object to compare against.
Comparable.compareTo(java.lang.Object)public boolean equals(Object obj)
obj - The CrontabEntry to compare against.
public String toString()
public void updateEntryTime()
protected void setCounterValue()
protected void adjustExecutionTime(Calendar now,
Calendar alarm)
now - 'now' calendar instancealarm - the next instance that the calendar should execute.public String getJobNumber()
public void setJobNumber(String s)
s - Job Number for this CrontabEntry's associated JobQueue entry
|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||