org.seedstack.scheduler.ExceptionPolicy Maven / Gradle / Ivy
/**
* Copyright (c) 2013-2016, The SeedStack authors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
package org.seedstack.scheduler;
/**
* This enum describes the behaviors of exception handling during the task execution.
*
*
* - REFIRE_IMMEDIATELY
* - Immediately reexecutes the task. Be careful when using this option.
* If the task will always fail, it will be executed indefinitely.
*
* - UNSCHEDULE_FIRING_TRIGGER
* - Unschedules the trigger which fire the task.
* It could be useful when the job fail due to a specific trigger.
*
* - UNSCHEDULE_ALL_TRIGGERS
* - Unschedules all the triggers associated to a task.
*
* - NONE (Used by default)
* - Do nothing
*
*/
public enum ExceptionPolicy {
/**
* Immediately re-execute the task. Be careful when using this option.
* If the task will always fail, it will be executed indefinitely.
*/
REFIRE_IMMEDIATELY,
/**
* Unschedule the trigger which fire the task.
* It could be useful when the job fail due to a specific trigger.
*/
UNSCHEDULE_FIRING_TRIGGER,
/**
* Unschedule all the triggers associated to a task.
*/
UNSCHEDULE_ALL_TRIGGERS,
/**
* Do nothing on exception. Task will execute again on the next trigger fire.
*/
NONE
}