public class CronTrigger extends java.lang.Object implements Trigger
Trigger
implementation for cron expressions.
Wraps a CronSequenceGenerator
.CronSequenceGenerator
Constructor and Description |
---|
CronTrigger(java.lang.String expression)
Build a
CronTrigger from the pattern provided in the default time zone. |
CronTrigger(java.lang.String expression,
java.util.TimeZone timeZone)
Build a
CronTrigger from the pattern provided in the given time zone. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other) |
java.lang.String |
getExpression()
Return the cron pattern that this trigger has been built with.
|
int |
hashCode() |
java.util.Date |
nextExecutionTime(TriggerContext triggerContext)
Determine the next execution time according to the given trigger context.
|
java.lang.String |
toString() |
public CronTrigger(java.lang.String expression)
CronTrigger
from the pattern provided in the default time zone.expression
- a space-separated list of time fields, following cron
expression conventionspublic CronTrigger(java.lang.String expression, java.util.TimeZone timeZone)
CronTrigger
from the pattern provided in the given time zone.expression
- a space-separated list of time fields, following cron
expression conventionstimeZone
- a time zone in which the trigger times will be generatedpublic java.lang.String getExpression()
public java.util.Date nextExecutionTime(TriggerContext triggerContext)
Next execution times are calculated based on the completion time of the previous execution; therefore, overlapping executions won't occur.
nextExecutionTime
in interface Trigger
triggerContext
- context object encapsulating last execution times
and last completion timenull
if the trigger won't fire anymorepublic boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object