AsyncTaskSvc.I Interface

com.bea.ide.core.asynctask
AsyncTaskSvc.I Interface

public static interface AsyncTaskSvc.I
Enclosing class

AsyncTaskSvc

Method Summary

public void
addTask(IAsyncTask task)
Adds the given task to the queue for processing.
public void
addTask(IAsyncTask task, int threadPriority)
Adds the given task to the queue for processing.
public void
addTask(IAsyncTask task, int threadPriority, boolean interruptOnWorkspaceClose)
Adds the given task to the queue for processing.
public void
interruptTask(IAsyncTask task)
Interrupt the processing of the given task.
public void
showDialogWhileRunning(String message, int timeoutBeforeReturn, Runnable runnable)
Runs the given job on a background thread, while blocking the AWT thread until either the job is performed or the delay is reached.
public void
showDialogWhileRunning(String message, Runnable runnable)
Convenience method for use if the dialog should never time out.

Method Detail

addTask(IAsyncTask) Method

public void addTask(IAsyncTask task)
Adds the given task to the queue for processing. This task will be interrupted if the active workspace closes.

Related Topics

DefaultAsyncTask


addTask(IAsyncTask, int) Method

public void addTask(IAsyncTask task, 
                    int threadPriority)
Adds the given task to the queue for processing. This version allows setting the priority of the background thread. Note that threadPriority in no way affects the execution order. This task will be interrupted if the active workspace closes.

Parameters

task
Task object to run
threadPriority
priority to set thread at while running

Related Topics

DefaultAsyncTask


addTask(IAsyncTask, int, boolean) Method

public void addTask(IAsyncTask task, 
                    int threadPriority, 
                    boolean interruptOnWorkspaceClose)
Adds the given task to the queue for processing. This version allows setting the priority of the background thread. Note that threadPriority in no way affects the execution order.

Parameters

task
Task object to run
threadPriority
priority to set thread at while running
interruptOnWorkspaceClose
whether this task should be interrupted on workspace close

Related Topics

DefaultAsyncTask


interruptTask(IAsyncTask) Method

public void interruptTask(IAsyncTask task)
Interrupt the processing of the given task. If this task has not started executing, then it will not be executed. If it has started executing, then it's thread will be interrupted. The task is allowed to throw an AsyncTaskInterruptedException in order to cause its execution to terminate.


showDialogWhileRunning(String, int, Runnable) Method

public void showDialogWhileRunning(String message, 
                                   int timeoutBeforeReturn, 
                                   Runnable runnable)
throws InterruptedException
Runs the given job on a background thread, while blocking the AWT thread until either the job is performed or the delay is reached. If the delay is reached before the job finishes, a dialog is displayed with the message passed in, which allows the AWT thread to perform other work while the job is completed.

After the dialog is displayed, the job will be given the timeout period to finish running. At that point, if the job is not finished, the dialog will be cleared, and this method will return false.

This method is only truly useful if called on the AWT thread. If called on a different thread, it simply runs the job directly with no timeout or dialog.

Parameters

message
The message to display in the dialog
timeoutBeforeReturn
The amount of time in milliseconds to wait before deciding this job has timed out. If reached, this method will return false. If set to -1, this job will never time out.
runnable
The job to run.

Exceptions

InterruptedException

showDialogWhileRunning(String, Runnable) Method

public void showDialogWhileRunning(String message, 
                                   Runnable runnable)
Convenience method for use if the dialog should never time out.