Interface Cancellable

public interface Cancellable

Allows long-running operations to be canceled.

Method Summary
 void cancel()
          Cancels a long-running operation.
 boolean isCancelled()
          Whether or not the operation has been canceled.

Method Detail


void cancel()

Cancels a long-running operation. The operation may not be terminated immediately, but may end at the earliest possible convenience of the implementor.

Consecutive calls to this method must not have any additional effect.

The isCancelled() property must be set to return true by the end of the cancel method.

The state of the operation after a cancel is undefined by this method, but gurantees may be made by particular implementors.


boolean isCancelled()
Whether or not the operation has been canceled. That this method returns true only indicates that a request to cancel has been registered - the operation may still be performing work until some convenient time to exit is reached.

Returns true if the cancel() method has been called; false otherwise.