de.sciss.common
Interface ProcessingThread.Client

Enclosing class:
ProcessingThread

public static interface ProcessingThread.Client


Field Summary
static int CANCELLED
           
static int DONE
           
static int FAILED
           
 
Method Summary
 void processCancel(ProcessingThread context)
          This gets invoked when the user requests to abort the process.
 void processFinished(ProcessingThread context)
          This gets invoked when processRun() is finished or aborted.
 int processRun(ProcessingThread context)
          Does the processing.
 

Field Detail

DONE

static final int DONE
See Also:
Constant Field Values

FAILED

static final int FAILED
See Also:
Constant Field Values

CANCELLED

static final int CANCELLED
See Also:
Constant Field Values
Method Detail

processRun

int processRun(ProcessingThread context)
               throws java.io.IOException
Does the processing. This is called inside a separate asynchronous thread.

Parameters:
context - the corresponding thread. call context.setProgression() to update visual progress feedback.
Returns:
return code, which is either of DONE on success, FAILED on failure, or CANCELLED if cancelled. The implementing class may which to call the context's setException method if an error occurs.
Throws:
java.io.IOException
See Also:
ProcessingThread.setProgression( float ), ProcessingThread.setException( Exception )
Synchronization:
like Thread's run method, this is called inside a custom thread

processFinished

void processFinished(ProcessingThread context)
This gets invoked when processRun() is finished or aborted. It's useful to place GUI related stuff in here since this gets called inside the Swing thread.

Parameters:
context - the corresponding thread. in case of failure can be used to query the exception.
Synchronization:
this is called in the event thread

processCancel

void processCancel(ProcessingThread context)
This gets invoked when the user requests to abort the process. The client should set a signal flag for the processing routine to cancel as soon as possible. All partly commited edits should be undone.

Parameters:
context - the corresponding thread. in case of failure can be used to query the exception.
Synchronization:
this is called in the event thread