org.netbeans.microedition.util
Interface CancellableTask

All Superinterfaces:
java.lang.Runnable
All Known Implementing Classes:
SimpleCancellableTask

public interface CancellableTask
extends java.lang.Runnable

A CancellableTask object is used in WaitScreen component to be run in the background.


Method Summary
 boolean cancel()
          Advises to interrupt the run method and cancel it's task.
 java.lang.String getFailureMessage()
          Gets the reason for the failure.
 boolean hasFailed()
          Informs whether the task run was not successfull.
 
Methods inherited from interface java.lang.Runnable
run
 

Method Detail

cancel

boolean cancel()
Advises to interrupt the run method and cancel it's task. It's the task responsibility to implement the cancel method in a cooperative manner.

Returns:
true if the task was successfully cancelled, false otherwise

hasFailed

boolean hasFailed()
Informs whether the task run was not successfull. For example when an exception was thrown in the task code.

Returns:
true if the task did not finish correctly. False if everything was ok.

getFailureMessage

java.lang.String getFailureMessage()
Gets the reason for the failure. In the case there was not any failure, this method should return null.

Returns:
A descriptive message of the failuire or null if there was no failure.