Interface ScheduledTask
public interface ScheduledTask
Represents a task scheduled to a scheduler.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumRepresents the result of attempting to cancel a task.static enumRepresents the current execution state of the task. -
Method Summary
Modifier and TypeMethodDescriptioncancel()Attempts to cancel this task, returning the result of the attempt.Returns the current execution state of this task.Returns the plugin that scheduled this task.default booleanReturns whether the current execution state isScheduledTask.ExecutionState.CANCELLEDorScheduledTask.ExecutionState.CANCELLED_RUNNING.booleanReturns whether this task executes on a fixed period, as opposed to executing only once.
-
Method Details
-
getOwningPlugin
Returns the plugin that scheduled this task.- Returns:
- the plugin that scheduled this task.
-
isRepeatingTask
boolean isRepeatingTask()Returns whether this task executes on a fixed period, as opposed to executing only once.- Returns:
- whether this task executes on a fixed period, as opposed to executing only once.
-
cancel
Attempts to cancel this task, returning the result of the attempt. In all cases, if the task is currently being executed no attempt is made to halt the task, however any executions in the future are halted.- Returns:
- the result of the cancellation attempt.
-
getExecutionState
Returns the current execution state of this task.- Returns:
- the current execution state of this task.
-
isCancelled
default boolean isCancelled()Returns whether the current execution state isScheduledTask.ExecutionState.CANCELLEDorScheduledTask.ExecutionState.CANCELLED_RUNNING.- Returns:
- whether the current execution state is
ScheduledTask.ExecutionState.CANCELLEDorScheduledTask.ExecutionState.CANCELLED_RUNNING.
-