org.quartz.spi.OperableTrigger Maven / Gradle / Ivy
Show all versions of org.apache.servicemix.bundles.quartz
package org.quartz.spi;
import java.util.Date;
import org.quartz.Calendar;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
public interface OperableTrigger extends MutableTrigger {
/**
*
* This method should not be used by the Quartz client.
*
*
*
* Called when the {@link Scheduler}
has decided to 'fire'
* the trigger (execute the associated Job
), in order to
* give the Trigger
a chance to update itself for its next
* triggering (if any).
*
*
* @see #executionComplete(JobExecutionContext, JobExecutionException)
*/
public void triggered(Calendar calendar);
/**
*
* This method should not be used by the Quartz client.
*
*
*
* Called by the scheduler at the time a Trigger
is first
* added to the scheduler, in order to have the Trigger
* compute its first fire time, based on any associated calendar.
*
*
*
* After this method has been called, getNextFireTime()
* should return a valid answer.
*
*
* @return the first time at which the Trigger
will be fired
* by the scheduler, which is also the same value getNextFireTime()
* will return (until after the first firing of the Trigger
).
*
*/
public Date computeFirstFireTime(Calendar calendar);
/**
*
* This method should not be used by the Quartz client.
*
*
*
* Called after the {@link Scheduler}
has executed the
* {@link org.quartz.JobDetail}
associated with the Trigger
* in order to get the final instruction code from the trigger.
*
*
* @param context
* is the JobExecutionContext
that was used by the
* Job
'sexecute(xx)
method.
* @param result
* is the JobExecutionException
thrown by the
* Job
, if any (may be null).
* @return one of the CompletedExecutionInstruction
constants.
*
* @see CompletedExecutionInstruction
* @see #triggered(Calendar)
*/
public CompletedExecutionInstruction executionComplete(JobExecutionContext context, JobExecutionException result);
/**
*
* This method should not be used by the Quartz client.
*
*
*
* To be implemented by the concrete classes that extend this class.
*
*
*
* The implementation should update the Trigger
's state
* based on the MISFIRE_INSTRUCTION_XXX that was selected when the Trigger
* was created.
*
*/
public void updateAfterMisfire(Calendar cal);
/**
*
* This method should not be used by the Quartz client.
*
*
*
* To be implemented by the concrete class.
*
*
*
* The implementation should update the Trigger
's state
* based on the given new version of the associated Calendar
* (the state should be updated so that it's next fire time is appropriate
* given the Calendar's new settings).
*
*
* @param cal
*/
public void updateWithNewCalendar(Calendar cal, long misfireThreshold);
/**
*
* Validates whether the properties of the JobDetail
are
* valid for submission into a Scheduler
.
*
* @throws IllegalStateException
* if a required property (such as Name, Group, Class) is not
* set.
*/
public void validate() throws SchedulerException;
/**
*
* This method should not be used by the Quartz client.
*
*
*
* Usable by {@link org.quartz.spi.JobStore}
* implementations, in order to facilitate 'recognizing' instances of fired
* Trigger
s as their jobs complete execution.
*
*
*
*/
public void setFireInstanceId(String id);
/**
*
* This method should not be used by the Quartz client.
*
*/
public String getFireInstanceId();
public void setNextFireTime(Date nextFireTime);
public void setPreviousFireTime(Date previousFireTime);
}