Interface IScheduledFuture<V>

  • Type Parameters:
    V - The result type returned by this Future
    All Superinterfaces:
    java.lang.Comparable<java.util.concurrent.Delayed>, java.util.concurrent.Delayed, java.util.concurrent.Future<V>, java.util.concurrent.ScheduledFuture<V>

    public interface IScheduledFuture<V>
    extends java.util.concurrent.ScheduledFuture<V>
    A delayed result-bearing action that can be cancelled. Usually a scheduled future is the result of scheduling a task with a IScheduledExecutorService. Enhances the default ScheduledFuture API with support of statistics and time measurement info, through ScheduledTaskStatistics
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean cancel​(boolean mayInterruptIfRunning)
      Attempts to cancel further scheduling of this task.
      void dispose()
      Used to destroy the instance of the IScheduledFuture in the scheduled executor.
      ScheduledTaskHandler getHandler()
      Returns the scheduled future resource handler.
      ScheduledTaskStatistics getStats()
      Returns the statistics and time measurement info of the execution of this scheduled future in the IScheduledExecutorService it was scheduled.
      • Methods inherited from interface java.lang.Comparable

      • Methods inherited from interface java.util.concurrent.Delayed

      • Methods inherited from interface java.util.concurrent.Future

        get, get, isCancelled, isDone
    • Method Detail

      • cancel

        boolean cancel​(boolean mayInterruptIfRunning)
        Attempts to cancel further scheduling of this task. This attempt will fail if the task has already completed, has already been cancelled, or could not be cancelled for some other reason. If successful, and this task has not started when cancel is called, this task should never run.

        Warning: This cancel will not attempt to interrupt the running thread if the task is already in progress, will just cancel further scheduling.

        After this method returns, subsequent calls to Future.isDone() will always return true. Subsequent calls to Future.isCancelled() will always return true if this method returned true.

        Specified by:
        cancel in interface java.util.concurrent.Future<V>
        mayInterruptIfRunning - is throwing UnsupportedOperationException
        false if the task could not be cancelled, typically because it has already completed normally; true otherwise