org.springframework.scheduling.support
Class CronTrigger
java.lang.Object
org.springframework.scheduling.support.CronTrigger
- All Implemented Interfaces:
- Trigger
public class CronTrigger
- extends java.lang.Object
- implements Trigger
Trigger
implementation for cron expressions.
Wraps a CronSequenceGenerator
.
- Since:
- 3.0
- Author:
- Juergen Hoeller
- See Also:
CronSequenceGenerator
Constructor Summary |
CronTrigger(java.lang.String cronExpression)
Build a CronTrigger from the pattern provided in the default time zone. |
CronTrigger(java.lang.String cronExpression,
java.util.TimeZone timeZone)
Build a CronTrigger from the pattern provided. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
sequenceGenerator
private final CronSequenceGenerator sequenceGenerator
CronTrigger
public CronTrigger(java.lang.String cronExpression)
- Build a
CronTrigger
from the pattern provided in the default time zone.
- Parameters:
cronExpression
- a space-separated list of time fields,
following cron expression conventions
CronTrigger
public CronTrigger(java.lang.String cronExpression,
java.util.TimeZone timeZone)
- Build a
CronTrigger
from the pattern provided.
- Parameters:
cronExpression
- a space-separated list of time fields,
following cron expression conventionstimeZone
- a time zone in which the trigger times will be generated
nextExecutionTime
public java.util.Date nextExecutionTime(TriggerContext triggerContext)
- Description copied from interface:
Trigger
- Determine the next execution time according to the given trigger context.
- Specified by:
nextExecutionTime
in interface Trigger
- Parameters:
triggerContext
- context object encapsulating last execution times
and last completion time
- Returns:
- the next execution time as defined by the trigger,
or
null
if the trigger won't fire anymore
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in class java.lang.Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object