com.scalagent.scheduler
Class CronEvent
java.lang.Object
com.scalagent.scheduler.ScheduleEvent
com.scalagent.scheduler.CronEvent
- All Implemented Interfaces:
- java.io.Serializable
public class CronEvent
- extends ScheduleEvent
Event requesting a recurrent scheduling to a Scheduler
.
The recurring occurrence time is described in a cron like syntax, that is :
= [ 0-59 | * ]
= [ 0-23 | * ]
= [ 1-31 | * ]
= [ 0-11 | * ]
= [ 0-6 | * ]
- See Also:
Scheduler
,
ScheduleEvent
,
Serialized Form
Constructor Summary |
CronEvent(java.lang.String name,
java.lang.String date)
Creates an item. |
Method Summary |
protected java.util.Date |
nextDate(java.util.Date now)
Returns the next scheduling date after current date given as parameter. |
java.lang.StringBuffer |
toString(java.lang.StringBuffer output)
Provides a string image for this object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
CronEvent
public CronEvent(java.lang.String name,
java.lang.String date)
throws java.lang.IllegalArgumentException
- Creates an item.
- Parameters:
name
- event namedate
- event scheduling date as a cron like string
- Throws:
java.lang.IllegalArgumentException
- when date is misformed
toString
public java.lang.StringBuffer toString(java.lang.StringBuffer output)
- Provides a string image for this object.
- Overrides:
toString
in class ScheduleEvent
- Returns:
- a string image for this object
nextDate
protected java.util.Date nextDate(java.util.Date now)
- Returns the next scheduling date after current date given as parameter. The
new date must be strictly greater than the current date. A
null
date leads to the scheduler deleting the event.
- Overrides:
nextDate
in class ScheduleEvent
- Parameters:
now
- current date
- Returns:
- next scheduling date after now
Copyright © 2011 ScalAgent D.T.. All Rights Reserved.