Class AwaitableNoOpRunnable
- java.lang.Object
-
- com.pervasivecode.utils.concurrent.testing.AwaitableNoOpRunnable
-
- All Implemented Interfaces:
AwaitableRunnable,Runnable
public class AwaitableNoOpRunnable extends Object implements AwaitableRunnable
This is a simple Runnable whose only purpose is to signal that it has finished running. Task completion can be awaited via theawaitTaskCompletion()method. Task status (finished or not) can be observed via thehasTaskFinished()method.
-
-
Constructor Summary
Constructors Constructor Description AwaitableNoOpRunnable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidawaitTaskCompletion()booleanawaitTaskCompletion(long amount, TimeUnit unit)booleanhasTaskFinished()voidrun()
-
-
-
Method Detail
-
hasTaskFinished
public boolean hasTaskFinished()
- Specified by:
hasTaskFinishedin interfaceAwaitableRunnable
-
awaitTaskCompletion
public void awaitTaskCompletion() throws InterruptedException- Specified by:
awaitTaskCompletionin interfaceAwaitableRunnable- Throws:
InterruptedException
-
awaitTaskCompletion
public boolean awaitTaskCompletion(long amount, TimeUnit unit) throws InterruptedException- Specified by:
awaitTaskCompletionin interfaceAwaitableRunnable- Throws:
InterruptedException
-
-