chemaxon.marvin.view
Interface TaskScheduler


public interface TaskScheduler

Generic task scheduler interface.

Since:
Marvin 5.2, 02/24/2009
Version:
5.2, 02/24/2009
Author:
Peter Csizmadia

Method Summary
 void invokeAndWait(java.lang.Runnable runnable)
          Enqueues a task on the scheduler's thread and waits for its completion.
 void invokeLater(java.lang.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(java.lang.Runnable task,
                 int priority)
Enqueues a task on the scheduler's thread.

Parameters:
task - the task
priority - lower number means higher priority
See Also:
waitForAll()

invokeAndWait

void invokeAndWait(java.lang.Runnable runnable)
                   throws java.lang.InterruptedException,
                          java.lang.reflect.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:
java.lang.InterruptedException - if another thread has interrupted the task thread
java.lang.reflect.InvocationTargetException - if an throwable is thrown when running runnable
See Also:
invokeLater(Runnable, int), waitForAll()

waitForAll

void waitForAll()
                throws java.lang.InterruptedException
Waits for all tasks to finish.

Throws:
java.lang.InterruptedException - if another thread has interrupted the task thread
See Also:
invokeLater(Runnable, int)