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 void
awaitTaskCompletion()
boolean
awaitTaskCompletion(long amount, TimeUnit unit)
boolean
hasTaskFinished()
void
run()
-
-
-
Method Detail
-
hasTaskFinished
public boolean hasTaskFinished()
- Specified by:
hasTaskFinished
in interfaceAwaitableRunnable
-
awaitTaskCompletion
public void awaitTaskCompletion() throws InterruptedException
- Specified by:
awaitTaskCompletion
in interfaceAwaitableRunnable
- Throws:
InterruptedException
-
awaitTaskCompletion
public boolean awaitTaskCompletion(long amount, TimeUnit unit) throws InterruptedException
- Specified by:
awaitTaskCompletion
in interfaceAwaitableRunnable
- Throws:
InterruptedException
-
-