Skip to content

Commit

Permalink
javadoc added.
Browse files Browse the repository at this point in the history
LocalTimeScheduler removed.
  • Loading branch information
andranikm committed Dec 2, 2013
1 parent 459751c commit 429aafa
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
12 changes: 11 additions & 1 deletion jdeeco-core/src/cz/cuni/mff/d3s/deeco/scheduler/Scheduler.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,14 @@ public interface Scheduler extends ExecutionListener {
*/
public void setExecutor(Executor executor);

void invokeAndWait(Runnable doRun) throws InterruptedException;}
/**
* Invokes the runnable and waits for it to finish.
* <p>
* <b>Note:</b> This method is strongly implementation-based so it is advised to check with the documentation
* specific for each Scheduler implementation.
*
* @param doRun the runnable to invoke.
* @throws InterruptedException if the invocation was interrupted.
*/
void invokeAndWait(Runnable doRun) throws InterruptedException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,14 @@ public void setExecutor(Executor executor) {


/**
* This function is an updated addTask for one-time execution tasks.
* Not only it adds the task to the task list but also attaches a runnable
* instance to it and calling wait() on the task, which sets it to sleep
* until woken up by anyone calling notify() on same monitor.
* This method instantiates a special kind of task of type
* {@link cz.cuni.mff.d3s.deeco.scheduler.InvokeAndWaitTask InvokeAndWaitTask}
* attaching a runnable and a scheduler, in whose context the runnable will run, to it.
* After executing the task(which will invoke the runnable) and adding it to the list of the tasks
* it waits, until awaken by someone's notification sharing a monitor with that task.
*
* @param doRun the runnable instance
* @throws InterruptedException
* @param doRun the runnable instance
* @throws InterruptedException when the invocation is interrupted
*/
public void invokeAndWait(Runnable doRun) throws InterruptedException {
InvokeAndWaitTask task = new InvokeAndWaitTask(this, doRun);
Expand Down

0 comments on commit 429aafa

Please sign in to comment.