Package chemaxon.marvin.view
Interface TaskScheduler
-
@PublicAPI public interface TaskScheduler
Generic task scheduler interface.- Since:
- Marvin 5.2, 02/24/2009
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
invokeAndWait(Runnable runnable)
Enqueues a task on the scheduler's thread and waits for its completion.void
invokeLater(Runnable task, int priority)
Enqueues a task on the scheduler's thread.void
waitForAll()
Waits for all tasks to finish.
-
-
-
Method Detail
-
invokeLater
void invokeLater(Runnable task, int priority)
Enqueues a task on the scheduler's thread.- Parameters:
task
- the taskpriority
- lower number means higher priority- See Also:
waitForAll()
-
invokeAndWait
void invokeAndWait(Runnable runnable) throws InterruptedException, InvocationTargetException
Enqueues a task on the scheduler's thread and waits for its completion. The task is scheduled with zero priority.- Parameters:
runnable
- the task- Throws:
InterruptedException
- if another thread has interrupted the task threadInvocationTargetException
- if an throwable is thrown when runningrunnable
- See Also:
invokeLater(Runnable, int)
,waitForAll()
-
waitForAll
void waitForAll() throws InterruptedException
Waits for all tasks to finish.- Throws:
InterruptedException
- if another thread has interrupted the task thread- See Also:
invokeLater(Runnable, int)
-
-