org.springframework.integration.scheduling
Class CronTrigger
java.lang.Object
org.springframework.integration.scheduling.CronTrigger
- All Implemented Interfaces:
- Trigger
public class CronTrigger
- extends java.lang.Object
- implements Trigger
A trigger that uses a cron expression. See CronSequenceGenerator
for a detailed description of the expression pattern syntax.
- Author:
- Mark Fisher
Constructor Summary |
CronTrigger(java.lang.String expression)
Create a trigger for the given cron expression. |
Method Summary |
boolean |
equals(java.lang.Object other)
|
java.util.Date |
getNextRunTime(java.util.Date lastScheduledRunTime,
java.util.Date lastCompleteTime)
Return the next time a task should run. |
int |
hashCode()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
CronTrigger
public CronTrigger(java.lang.String expression)
throws java.lang.IllegalArgumentException
- Create a trigger for the given cron expression.
See
CronSequenceGenerator
.
- Throws:
java.lang.IllegalArgumentException
getNextRunTime
public java.util.Date getNextRunTime(java.util.Date lastScheduledRunTime,
java.util.Date lastCompleteTime)
- Return the next time a task should run. Determined by consulting this
trigger's cron expression compared with the lastCompleteTime. If the
lastCompleteTime is
null
, the current time is used.
- Specified by:
getNextRunTime
in interface Trigger
- Parameters:
lastScheduledRunTime
- last time the relevant task was scheduled to
run, or null
if it has never been scheduledlastCompleteTime
- last time the relevant task finished or
null
if it did not run to completion
- Returns:
- next time that a task should run
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in class java.lang.Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object