org.quartz.triggers.OperableTrigger Maven / Gradle / Ivy
Show all versions of sundial Show documentation
/**
* Copyright 2015 Knowm Inc. (http://knowm.org) and contributors.
* Copyright 2013-2015 Xeiam LLC (http://xeiam.com) and contributors.
* Copyright 2001-2011 Terracotta Inc. (http://terracotta.org).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.quartz.triggers;
import java.util.Date;
import org.quartz.core.Calendar;
import org.quartz.core.JobExecutionContext;
import org.quartz.core.Scheduler;
import org.quartz.exceptions.JobExecutionException;
import org.quartz.exceptions.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.jobs.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);
/**
*
* 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.core.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);
}