|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jvnet.hk2.component.AsyncWaiter
public class AsyncWaiter
Helper class that will manage all AsyncPostConstruct services
and Futures for completion.
| Constructor Summary | |
|---|---|
AsyncWaiter()
|
|
| Method Summary | |
|---|---|
void |
clear()
Clear the collection of watches, regardless of state. |
Inhabitant<?> |
getLastInhabitantWorkingOn()
Returns the last Inhabitant that was working on, provided that we are not in a "done" state. |
int |
getWatches()
|
boolean |
isDone()
A non-blocking call that returns true when we are done waiting. |
void |
waitForDone()
Waits for all watches to be done. |
boolean |
waitForDone(long timeout,
TimeUnit unit)
Wait's for all inhabitants being watched to be done, giving each up to timeout/unit's to be done. |
void |
watchIfNecessary(Future<?> f)
Watches a Future for completion. |
void |
watchIfNecessary(Inhabitant<?> i)
Watches an inhabitant if the service implements AsyncPostConstruct. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AsyncWaiter()
| Method Detail |
|---|
public void clear()
public void watchIfNecessary(Inhabitant<?> i)
AsyncPostConstruct.
public void watchIfNecessary(Future<?> f)
public void waitForDone()
throws ExecutionException,
TimeoutException,
InterruptedException
ExecutionException
TimeoutException
InterruptedException
public boolean waitForDone(long timeout,
TimeUnit unit)
throws ExecutionException,
TimeoutException,
InterruptedException
TimeoutExceptions
the result will be false.
ExecutionException
TimeoutException
InterruptedExceptionpublic int getWatches()
public boolean isDone()
public Inhabitant<?> getLastInhabitantWorkingOn()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||