RESULT - public class ComponentFuture<RESULT>
extends cz.cuni.amis.utils.future.FutureWithListeners<RESULT>
IComponent. This future guarantees
that it unblock all threads waiting for the result if the world view (or other component(s) specified
via ComponentFuture(IComponentBus, IComponent...)) dies.| Constructor and Description |
|---|
ComponentFuture(IComponentBus bus,
IComponent... dependants)
Constructor where you have to specify components on which the result depends + its component bus.
|
| Modifier and Type | Method and Description |
|---|---|
protected CountDownLatch |
createLatch() |
RESULT |
get()
Blocks until the future is computed and then returns the result of the computation.
|
RESULT |
get(long timeout,
TimeUnit unit)
Blocks until the future is computed (or timeout) and then returns the result of the computation.
|
public ComponentFuture(IComponentBus bus, IComponent... dependants)
bus - may be null - in this case a simple CountDownLatch is created instead of BusAwareCountDownLatchdependants - may be null or zero-length - in this case a simple CountDownLatch is created instead of BusAwareCountDownLatchprotected CountDownLatch createLatch()
createLatch in class cz.cuni.amis.utils.future.FutureWithListeners<RESULT>public RESULT get() throws ComponentFutureException
If the result can't be computed (computation is cancelled, exception happens or some component working on the future
result stops), throws an ComponentFutureException.
For additional info, see FutureWithListeners.get().
get in interface Future<RESULT>get in class cz.cuni.amis.utils.future.FutureWithListeners<RESULT>ComponentFutureExceptionpublic RESULT get(long timeout, TimeUnit unit) throws ComponentFutureException
If the result can't be computed (computation is cancelled, exception happens or some component working on the future
result stops), throws an ComponentFutureException.
For additional info, see FutureWithListeners.get(long, TimeUnit).
get in interface Future<RESULT>get in class cz.cuni.amis.utils.future.FutureWithListeners<RESULT>timeout - unit - ComponentFutureExceptionCopyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.