Interface ScheduledTask


public interface ScheduledTask
Represents a task scheduled to a scheduler.
  • Method Details

    • getOwningPlugin

      @NotNull @NotNull Plugin 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

      @NotNull @NotNull ScheduledTask.CancelledState 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

      @NotNull @NotNull ScheduledTask.ExecutionState 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 is ScheduledTask.ExecutionState.CANCELLED or ScheduledTask.ExecutionState.CANCELLED_RUNNING.