public class CronTrigger extends Object implements Trigger
Modifier and Type | Field and Description |
---|---|
protected static int |
YEAR_TO_GIVEUP_SCHEDULING_AT |
Constructor and Description |
---|
CronTrigger() |
CronTrigger(long timestamp,
Date startTime,
Date endTime,
int repeatLimit,
CronExpression cronExpression,
String[] calendarNames,
org.kie.api.runtime.Calendars calendars) |
CronTrigger(long timestamp,
Date startTime,
Date endTime,
int repeatLimit,
String cronExpression,
String[] calendarNames,
org.kie.api.runtime.Calendars calendars) |
Modifier and Type | Method and Description |
---|---|
static CronExpression |
determineCronExpression(String cronExpression) |
String[] |
getCalendarNames() |
org.kie.api.runtime.Calendars |
getCalendars() |
CronExpression |
getCronEx() |
Date |
getEndTime()
Get the time at which the
CronTrigger should quit
repeating - even if repeastCount isn't yet satisfied. |
Date |
getNextFireTime()
Returns the next time at which the
Trigger is scheduled to fire. |
Date |
getPreviousFireTime()
Returns the previous time at which the
CronTrigger
fired. |
int |
getRepeatCount() |
int |
getRepeatLimit() |
Date |
getStartTime() |
protected Date |
getTimeAfter(Date afterTime) |
TimeZone |
getTimeZone()
Returns the time zone for which the
cronExpression of
this CronTrigger will be resolved. |
Date |
hasNextFireTime()
This method is used to query the trigger about the existence of a
possible next fire time, but WITHOUT changing any internal state
of the trigger.
|
Date |
nextFireTime()
This method returns the date of the next fire time and updates
the internal state of the Trigger to the following fire time
if one exists.
|
void |
setCalendarNames(String[] calendarNames) |
void |
setCalendars(org.kie.api.runtime.Calendars calendars) |
void |
setCronEx(CronExpression cronEx) |
void |
setCronExpression(CronExpression cronExpression) |
void |
setCronExpression(String cronExpression) |
void |
setEndTime(Date endTime) |
void |
setFirstFireTimeAfter()
Returns the next time at which the
CronTrigger will fire,
after the given time. |
void |
setNextFireTime(Date nextFireTime)
Sets the next time at which the
CronTrigger will fire. |
void |
setPreviousFireTime(Date previousFireTime)
Set the previous time at which the
CronTrigger fired. |
void |
setRepeatCount(int repeatCount) |
void |
setRepeatLimit(int repeatLimit) |
void |
setStartTime(Date startTime) |
void |
setTimeZone(TimeZone timeZone)
Sets the time zone for which the
cronExpression of this
CronTrigger will be resolved. |
void |
updateToNextIncludeDate() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initialize
protected static final int YEAR_TO_GIVEUP_SCHEDULING_AT
public CronTrigger()
public CronTrigger(long timestamp, Date startTime, Date endTime, int repeatLimit, String cronExpression, String[] calendarNames, org.kie.api.runtime.Calendars calendars)
public CronTrigger(long timestamp, Date startTime, Date endTime, int repeatLimit, CronExpression cronExpression, String[] calendarNames, org.kie.api.runtime.Calendars calendars)
public Date getStartTime()
public void setStartTime(Date startTime)
public Date getEndTime()
Get the time at which the CronTrigger
should quit
repeating - even if repeastCount isn't yet satisfied.
public void setEndTime(Date endTime)
public Date getNextFireTime()
Returns the next time at which the Trigger
is scheduled to fire. If
the trigger will not fire again, null
will be returned. Note that
the time returned can possibly be in the past, if the time that was computed
for the trigger to next fire has already arrived, but the scheduler has not yet
been able to fire the trigger (which would likely be due to lack of resources
e.g. threads).
The value returned is not guaranteed to be valid until after the Trigger
has been added to the scheduler.
public Date getPreviousFireTime()
Returns the previous time at which the CronTrigger
fired. If the trigger has not yet fired, null
will be
returned.
public void setNextFireTime(Date nextFireTime)
Sets the next time at which the CronTrigger
will fire.
This method should not be invoked by client code.
public void setPreviousFireTime(Date previousFireTime)
Set the previous time at which the CronTrigger
fired.
This method should not be invoked by client code.
public TimeZone getTimeZone()
Returns the time zone for which the cronExpression
of
this CronTrigger
will be resolved.
public void setTimeZone(TimeZone timeZone)
Sets the time zone for which the cronExpression
of this
CronTrigger
will be resolved.
If setCronExpression(CronExpression)
is called after this
method, the TimeZon setting on the CronExpression will "win". However
if setCronExpression(String)
is called after this method, the
time zone applied by this method will remain in effect, since the
String cron expression does not carry a time zone!
public void setCronExpression(String cronExpression)
public void setCronExpression(CronExpression cronExpression)
public CronExpression getCronEx()
public void setCronEx(CronExpression cronEx)
public int getRepeatLimit()
public void setRepeatLimit(int repeatLimit)
public int getRepeatCount()
public void setRepeatCount(int repeatCount)
public String[] getCalendarNames()
public void setCalendarNames(String[] calendarNames)
public org.kie.api.runtime.Calendars getCalendars()
public void setCalendars(org.kie.api.runtime.Calendars calendars)
public static CronExpression determineCronExpression(String cronExpression)
public Date hasNextFireTime()
Trigger
hasNextFireTime
in interface Trigger
public Date nextFireTime()
Trigger
nextFireTime
in interface Trigger
public void setFirstFireTimeAfter()
Returns the next time at which the CronTrigger
will fire,
after the given time. If the trigger will not fire after the given time,
null
will be returned.
Note that the date returned is NOT validated against the related org.quartz.Calendar (if any)
public void updateToNextIncludeDate()
Copyright © 2001–2020 JBoss by Red Hat. All rights reserved.