Interface Task.Coordinator<T>

    • Method Detail

      • cancel

        boolean cancel​(boolean mayInterruptIfRunning)
        Attempts to cancel execution of the 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. If the task has already started, then the mayInterruptIfRunning parameter determines whether the thread executing this task should be interrupted in an attempt to stop the task.

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

        Parameters:
        mayInterruptIfRunning - true if the thread executing this task should be interrupted; otherwise, in-progress tasks are allowed to complete
        Returns:
        false if the task could not be cancelled, typically because it has already completed normally; true otherwise
        See Also:
        Future.cancel(boolean)
      • isCancelled

        boolean isCancelled()
        Returns true if the Task was cancelled before it completed normally.
        Returns:
        true if this task was cancelled before it completed
        See Also:
        Future.isCancelled()
      • isDone

        boolean isDone()
        Returns true if the Task completed. Completion may be due to normal termination, an exception, or cancellation -- in all of these cases, this method will return true.
        Returns:
        true if this task completed
        See Also:
        Future.isDone()
      • getTaskId

        String getTaskId()
        Obtains the unique identity of the Task being coordinated.
        Returns:
        the task identity
      • getProperties

        Task.Properties getProperties()
        Obtain the properties of the Task being coordinated.
        Returns:
        the task properties