After brief description of how the infrastructure works we need to look at writing a task in more detail. The interface you need to implement looks like:
public interface CancellableTask<P> {
public void cancel();
public void run( P parameter ) throws Exception;
}
We already mentioned what is the cancel() method good for. The more interesting and more important method obviously is the run() method. You may see that it takes a parameter of type P. P can be generally anything as the interface can be used in other context than the java infrastructure as well. However, when using it for implementation of the java related tasks the P can become: CompilationInfo, CompilationController or WorkingCopy. It depends in how you registered or started your task. Considering the ordering each of the parameter types adds some functionality you may use.