jobstore.java

来自「定时器开源项目, 相对于 jcrontab, Quartz 算是更完整的一个项目」· Java 代码 · 共 656 行 · 第 1/2 页

JAVA
656
字号
    public int getNumberOfTriggers(SchedulingContext ctxt)            throws JobPersistenceException;    /**     * <p>     * Get the number of <code>{@link org.quartz.Calendar}</code> s that are     * stored in the <code>JobsStore</code>.     * </p>     */    public int getNumberOfCalendars(SchedulingContext ctxt)            throws JobPersistenceException;    /**     * <p>     * Get the names of all of the <code>{@link org.quartz.Job}</code> s that     * have the given group name.     * </p>     *      * <p>     * If there are no jobs in the given group name, the result should be a     * zero-length array (not <code>null</code>).     * </p>     */    public String[] getJobNames(SchedulingContext ctxt, String groupName)            throws JobPersistenceException;    /**     * <p>     * Get the names of all of the <code>{@link org.quartz.Trigger}</code> s     * that have the given group name.     * </p>     *      * <p>     * If there are no triggers in the given group name, the result should be a     * zero-length array (not <code>null</code>).     * </p>     */    public String[] getTriggerNames(SchedulingContext ctxt, String groupName)            throws JobPersistenceException;    /**     * <p>     * Get the names of all of the <code>{@link org.quartz.Job}</code>     * groups.     * </p>     *      * <p>     * If there are no known group names, the result should be a zero-length     * array (not <code>null</code>).     * </p>     */    public String[] getJobGroupNames(SchedulingContext ctxt)            throws JobPersistenceException;    /**     * <p>     * Get the names of all of the <code>{@link org.quartz.Trigger}</code>     * groups.     * </p>     *      * <p>     * If there are no known group names, the result should be a zero-length     * array (not <code>null</code>).     * </p>     */    public String[] getTriggerGroupNames(SchedulingContext ctxt)            throws JobPersistenceException;    /**     * <p>     * Get the names of all of the <code>{@link org.quartz.Calendar}</code> s     * in the <code>JobStore</code>.     * </p>     *      * <p>     * If there are no Calendars in the given group name, the result should be     * a zero-length array (not <code>null</code>).     * </p>     */    public String[] getCalendarNames(SchedulingContext ctxt)            throws JobPersistenceException;    /**     * <p>     * Get all of the Triggers that are associated to the given Job.     * </p>     *      * <p>     * If there are no matches, a zero-length array should be returned.     * </p>     */    public Trigger[] getTriggersForJob(SchedulingContext ctxt, String jobName,            String groupName) throws JobPersistenceException;    /**     * <p>     * Get the current state of the identified <code>{@link Trigger}</code>.     * </p>     *      * @see Trigger#STATE_NORMAL     * @see Trigger#STATE_PAUSED     * @see Trigger#STATE_COMPLETE     * @see Trigger#STATE_ERROR     * @see Trigger#STATE_NONE     */    public int getTriggerState(SchedulingContext ctxt, String triggerName,            String triggerGroup) throws JobPersistenceException;    /////////////////////////////////////////////////////////////////////////////    //    // Trigger State manipulation methods    //    /////////////////////////////////////////////////////////////////////////////    /**     * <p>     * Pause the <code>{@link org.quartz.Trigger}</code> with the given name.     * </p>     *      * @see #resumeTrigger(SchedulingContext, String, String)     */    public void pauseTrigger(SchedulingContext ctxt, String triggerName,            String groupName) throws JobPersistenceException;    /**     * <p>     * Pause all of the <code>{@link org.quartz.Trigger}s</code> in the     * given group.     * </p>     *      *      * <p>     * The JobStore should "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(SchedulingContext, String)     */    public void pauseTriggerGroup(SchedulingContext ctxt, String groupName)            throws JobPersistenceException;    /**     * <p>     * Pause the <code>{@link org.quartz.Job}</code> with the given name - by     * pausing all of its current <code>Trigger</code>s.     * </p>     *      * @see #resumeJob(SchedulingContext, String, String)     */    public void pauseJob(SchedulingContext ctxt, String jobName,            String groupName) throws JobPersistenceException;    /**     * <p>     * Pause all of the <code>{@link org.quartz.Job}s</code> in the given     * group - by pausing all of their <code>Trigger</code>s.     * </p>     *      * <p>     * The JobStore should "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(SchedulingContext, String)     */    public void pauseJobGroup(SchedulingContext ctxt, String groupName)            throws JobPersistenceException;    /**     * <p>     * Resume (un-pause) the <code>{@link org.quartz.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(SchedulingContext, String, String)     */    public void resumeTrigger(SchedulingContext ctxt, String triggerName,            String groupName) throws JobPersistenceException;    /**     * <p>     * Resume (un-pause) all of the <code>{@link org.quartz.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(SchedulingContext, String)     */    public void resumeTriggerGroup(SchedulingContext ctxt, String groupName)            throws JobPersistenceException;    public Set getPausedTriggerGroups(SchedulingContext ctxt)        throws JobPersistenceException;    /**     * <p>     * Resume (un-pause) the <code>{@link org.quartz.Job}</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(SchedulingContext, String, String)     */    public void resumeJob(SchedulingContext ctxt, String jobName,            String groupName) throws JobPersistenceException;    /**     * <p>     * Resume (un-pause) all of the <code>{@link org.quartz.Job}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(SchedulingContext, String)     */    public void resumeJobGroup(SchedulingContext ctxt, String groupName)            throws JobPersistenceException;    /**     * <p>     * Pause all triggers - equivalent of calling <code>pauseTriggerGroup(group)</code>     * on every group.     * </p>     *      * <p>     * When <code>resumeAll()</code> is called (to un-pause), trigger misfire     * instructions WILL be applied.     * </p>     *      * @see #resumeAll(SchedulingContext)     * @see #pauseTriggerGroup(SchedulingContext, String)     */    public void pauseAll(SchedulingContext ctxt) throws JobPersistenceException;    /**     * <p>     * Resume (un-pause) all triggers - equivalent of 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(SchedulingContext)     */    public void resumeAll(SchedulingContext ctxt)            throws JobPersistenceException;    /////////////////////////////////////////////////////////////////////////////    //    // Trigger-Firing methods    //    /////////////////////////////////////////////////////////////////////////////    /**     * <p>     * Get a handle to the next trigger to be fired, and mark it as 'reserved'     * by the calling scheduler.     * </p>     *      * @see #releaseAcquiredTrigger(SchedulingContext, Trigger)     */    public Trigger acquireNextTrigger(SchedulingContext ctxt)            throws JobPersistenceException;    /**     * <p>     * Inform the <code>JobStore</code> that the scheduler no longer plans to     * fire the given <code>Trigger</code>, that it had previously acquired     * (reserved).     * </p>     */    public void releaseAcquiredTrigger(SchedulingContext ctxt, Trigger trigger)            throws JobPersistenceException;    /**     * <p>     * Inform the <code>JobStore</code> that the scheduler is now firing the     * given <code>Trigger</code> (executing its associated <code>Job</code>),     * that it had previously acquired (reserved).     * </p>     *      * @return null if the trigger or it's job or calendar no longer exist, or     *         if the trigger was not successfully put into the 'executing'     *         state.     */    public TriggerFiredBundle triggerFired(SchedulingContext ctxt,            Trigger trigger) throws JobPersistenceException;    /**     * <p>     * Inform the <code>JobStore</code> that the scheduler has completed the     * firing of the given <code>Trigger</code> (and the execution its     * associated <code>Job</code>), and that the <code>{@link org.quartz.JobDataMap}</code>     * in the given <code>JobDetail</code> should be updated if the <code>Job</code>     * is stateful.     * </p>     */    public void triggeredJobComplete(SchedulingContext ctxt, Trigger trigger,            JobDetail jobDetail, int triggerInstCode)            throws JobPersistenceException;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?