public interface ILspTaskExecutor
Runnable
objects and are typically
executed in an asynchronous fashion. Tasks can be monitored by registering
a listener.Modifier and Type | Method and Description |
---|---|
void |
abort()
Attempts to cancel all currently pending tasks and blocks until the task
queue is empty.
|
void |
addTaskListener(ILspTaskExecutorListener aTaskExecutorListener)
Adds a task listener to this task executor.
|
void |
destroy()
Calls
abort() and renders the task executor invalid to use. |
Future |
execute(TLspTaskExecutorRunnable aTaskExecutorRunnable)
Schedules the supplied
Runnable for execution. |
void |
flush()
Blocks until all currently pending tasks have finished.
|
void |
removeTaskListener(ILspTaskExecutorListener aTaskExecutorListener)
Removes a task listener from this task executor.
|
Future execute(TLspTaskExecutorRunnable aTaskExecutorRunnable)
Runnable
for execution. The actual
execution may take place at some unspecified point in the future. This
method therefore returns a Future
which can be used to query the
progress of the task. A return value of null
indicates that the
task was already executed when this method returned.aTaskExecutorRunnable
- the task to be executedFuture
for following up on the taskvoid flush()
void abort()
void destroy()
abort()
and renders the task executor invalid to use.void addTaskListener(ILspTaskExecutorListener aTaskExecutorListener)
aTaskExecutorListener
- a task executor listener that will be notified
of task updatesvoid removeTaskListener(ILspTaskExecutorListener aTaskExecutorListener)
aTaskExecutorListener
- a task executor listener that will no longer
be notified of task updates