scheduler.java
来自「Quartz 是个开源的作业调度框架」· Java 代码 · 共 978 行 · 第 1/3 页
JAVA
978 行
* Set the <code>JobFactory</code> that will be responsible for producing * instances of <code>Job</code> classes. * </p> * * <p> * JobFactories may be of use to those wishing to have their application * produce <code>Job</code> instances via some special mechanism, such as to * give the opertunity for dependency injection. * </p> * * @see org.quart.spi.JobFactory * @throws SchedulerException */ public void setJobFactory(JobFactory factory) throws SchedulerException; /////////////////////////////////////////////////////////////////////////// /// /// Scheduling-related Methods /// /////////////////////////////////////////////////////////////////////////// /** * <p> * Add the given <code>{@link org.quartz.JobDetail}</code> to the * Scheduler, and associate the given <code>{@link Trigger}</code> with * it. * </p> * * <p> * If the given Trigger does not reference any <code>Job</code>, then it * will be set to reference the Job passed with it into this method. * </p> * * @throws SchedulerException * if the Job or Trigger cannot be added to the Scheduler, or * there is an internal Scheduler error. */ public Date scheduleJob(JobDetail jobDetail, Trigger trigger) throws SchedulerException; /** * <p> * Schedule the given <code>{@link org.quartz.Trigger}</code> with the * <code>Job</code> identified by the <code>Trigger</code>'s settings. * </p> * * @throws SchedulerException * if the indicated Job does not exist, or the Trigger cannot be * added to the Scheduler, or there is an internal Scheduler * error. */ public Date scheduleJob(Trigger trigger) throws SchedulerException; /** * <p> * Remove the indicated <code>{@link Trigger}</code> from the scheduler. * </p> */ public boolean unscheduleJob(String triggerName, String groupName) throws SchedulerException; /** * <p> * Remove (delete) the <code>{@link org.quartz.Trigger}</code> with the * given name, and store the new given one - which must be associated * with the same job (the new trigger must have the job name & group specified) * - however, the new trigger need not have the same name as the old trigger. * </p> * * @param triggerName * The name of the <code>Trigger</code> to be replaced. * @param groupName * The group name of the <code>Trigger</code> to be replaced. * @param newTrigger * The new <code>Trigger</code> to be stored. * @return <code>null</code> if a <code>Trigger</code> with the given * name & group was not found and removed from the store, otherwise * the first fire time of the newly scheduled trigger. */ public Date rescheduleJob(String triggerName, String groupName, Trigger newTrigger) throws SchedulerException; /** * <p> * Add the given <code>Job</code> to the Scheduler - with no associated * <code>Trigger</code>. The <code>Job</code> will be 'dormant' until * it is scheduled with a <code>Trigger</code>, or <code>Scheduler.triggerJob()</code> * is called for it. * </p> * * <p> * The <code>Job</code> must by definition be 'durable', if it is not, * SchedulerException will be thrown. * </p> * * @throws SchedulerException * if there is an internal Scheduler error, or if the Job is not * durable, or a Job with the same name already exists, and * <code>replace</code> is <code>false</code>. */ public void addJob(JobDetail jobDetail, boolean replace) throws SchedulerException; /** * <p> * Delete the identified <code>Job</code> from the Scheduler - and any * associated <code>Trigger</code>s. * </p> * * @return true if the Job was found and deleted. * @throws SchedulerException * if there is an internal Scheduler error. */ public boolean deleteJob(String jobName, String groupName) throws SchedulerException; /** * <p> * Trigger the identified <code>{@link org.quartz.JobDetail}</code> * (execute it now) - the generated trigger will be non-volatile. * </p> */ public void triggerJob(String jobName, String groupName) throws SchedulerException; /** * <p> * Trigger the identified <code>{@link org.quartz.JobDetail}</code> * (execute it now) - the generated trigger will be volatile. * </p> */ public void triggerJobWithVolatileTrigger(String jobName, String groupName) throws SchedulerException; /** * <p> * Trigger the identified <code>{@link org.quartz.JobDetail}</code> * (execute it now) - the generated trigger will be non-volatile. * </p> * * @param jobName the name of the Job to trigger * @param groupName the group name of the Job to trigger * @param data the (possibly <code>null</code>) JobDataMap to be * associated with the trigger that fires the job immediately. */ public void triggerJob(String jobName, String groupName, JobDataMap data) throws SchedulerException; /** * <p> * Trigger the identified <code>{@link org.quartz.JobDetail}</code> * (execute it now) - the generated trigger will be volatile. * </p> * * @param jobName the name of the Job to trigger * @param groupName the group name of the Job to trigger * @param data the (possibly <code>null</code>) JobDataMap to be * associated with the trigger that fires the job immediately. */ public void triggerJobWithVolatileTrigger(String jobName, String groupName, JobDataMap data) throws SchedulerException; /** * <p> * Pause the <code>{@link org.quartz.JobDetail}</code> with the given * name - by pausing all of its current <code>Trigger</code>s. * </p> * * @see #resumeJob(String, String) */ public void pauseJob(String jobName, String groupName) throws SchedulerException; /** * <p> * Pause all of the <code>{@link org.quartz.JobDetail}s</code> in the * given group - by pausing all of their <code>Trigger</code>s. * </p> * * <p> * The Scheduler will "remember" that the group is paused, and impose the * pause on any new jobs that are added to the group while the group is * paused. * </p> * * @see #resumeJobGroup(String) */ public void pauseJobGroup(String groupName) throws SchedulerException; /** * <p> * Pause the <code>{@link Trigger}</code> with the given name. * </p> * * @see #resumeTrigger(String, String) */ public void pauseTrigger(String triggerName, String groupName) throws SchedulerException; /** * <p> * Pause all of the <code>{@link Trigger}s</code> in the given group. * </p> * * <p> * The Scheduler will "remember" that the group is paused, and impose the * pause on any new triggers that are added to the group while the group is * paused. * </p> * * @see #resumeTriggerGroup(String) */ public void pauseTriggerGroup(String groupName) throws SchedulerException; /** * <p> * Resume (un-pause) the <code>{@link org.quartz.JobDetail}</code> with * the given name. * </p> * * <p> * If any of the <code>Job</code>'s<code>Trigger</code> s missed one * or more fire-times, then the <code>Trigger</code>'s misfire * instruction will be applied. * </p> * * @see #pauseJob(String, String) */ public void resumeJob(String jobName, String groupName) throws SchedulerException; /** * <p> * Resume (un-pause) all of the <code>{@link org.quartz.JobDetail}s</code> * in the given group. * </p> * * <p> * If any of the <code>Job</code> s had <code>Trigger</code> s that * missed one or more fire-times, then the <code>Trigger</code>'s * misfire instruction will be applied. * </p> * * @see #pauseJobGroup(String) */ public void resumeJobGroup(String groupName) throws SchedulerException; /** * <p> * Resume (un-pause) the <code>{@link Trigger}</code> with the given * name. * </p> * * <p> * If the <code>Trigger</code> missed one or more fire-times, then the * <code>Trigger</code>'s misfire instruction will be applied. * </p> * * @see #pauseTrigger(String, String) */ public void resumeTrigger(String triggerName, String groupName) throws SchedulerException; /** * <p> * Resume (un-pause) all of the <code>{@link Trigger}s</code> in the * given group. * </p> * * <p> * If any <code>Trigger</code> missed one or more fire-times, then the * <code>Trigger</code>'s misfire instruction will be applied. * </p> * * @see #pauseTriggerGroup(String) */ public void resumeTriggerGroup(String groupName) throws SchedulerException; /** * <p> * Pause all triggers - similar to calling <code>pauseTriggerGroup(group)</code> * on every group, however, after using this method <code>resumeAll()</code> * must be called to clear the scheduler's state of 'remembering' that all * new triggers will be paused as they are added. * </p> * * <p> * When <code>resumeAll()</code> is called (to un-pause), trigger misfire * instructions WILL be applied. * </p> * * @see #resumeAll() * @see #pauseTriggerGroup(String) * @see #standby() */ public void pauseAll() throws SchedulerException; /** * <p> * Resume (un-pause) all triggers - similar to calling * <code>resumeTriggerGroup(group)</code> on every group. * </p> * * <p> * If any <code>Trigger</code> missed one or more fire-times, then the * <code>Trigger</code>'s misfire instruction will be applied. * </p> * * @see #pauseAll() */ public void resumeAll() throws SchedulerException; /** * <p> * Get the names of all known <code>{@link org.quartz.JobDetail}</code> * groups. * </p> */ public String[] getJobGroupNames() throws SchedulerException; /** * <p> * Get the names of all the <code>{@link org.quartz.JobDetail}s</code> * in the given group. * </p>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?