cz.cuni.amis.pogamut.base.component.bus.event
Class BusAwareCountDownLatch
java.lang.Object
java.util.concurrent.CountDownLatch
cz.cuni.amis.pogamut.base.component.bus.event.BusAwareCountDownLatch
public class BusAwareCountDownLatch
- extends CountDownLatch
Extends CoundDownLatch with ability to stop waiting when some component connected
to the bus fails which may indicate termination of all other components on the bus.
Thus further waiting doesn't make sense.
- Author:
- ik
BusAwareCountDownLatch
public BusAwareCountDownLatch(int count,
IComponentBus bus)
BusAwareCountDownLatch
public BusAwareCountDownLatch(int count,
IComponentBus bus,
IComponent... components)
BusAwareCountDownLatch
public BusAwareCountDownLatch(int count,
IComponentBus bus,
cz.cuni.amis.utils.token.IToken... componentIds)
countDown
public void countDown()
- Overrides:
countDown
in class CountDownLatch
await
public void await()
throws BusAwareCountDownLatch.BusStoppedInterruptedException,
cz.cuni.amis.utils.exception.PogamutInterruptedException
- Overrides:
await
in class CountDownLatch
- Throws:
BusAwareCountDownLatch.BusStoppedInterruptedException
- when the waiting was stopped because some component of the bus stopped
cz.cuni.amis.utils.exception.PogamutInterruptedException
await
public boolean await(long timeout,
TimeUnit unit)
throws BusAwareCountDownLatch.BusStoppedInterruptedException,
cz.cuni.amis.utils.exception.PogamutInterruptedException
- Overrides:
await
in class CountDownLatch
- Parameters:
timeout
- unit
-
- Returns:
-
- Throws:
BusAwareCountDownLatch.BusStoppedInterruptedException
- when the waiting was stopped because some component of the bus stopped
cz.cuni.amis.utils.exception.PogamutInterruptedException
checkBusStop
protected void checkBusStop()
throws BusAwareCountDownLatch.BusStoppedInterruptedException
- Throws:
BusAwareCountDownLatch.BusStoppedInterruptedException
toString
public String toString()
- Overrides:
toString
in class CountDownLatch
Copyright © 2014 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.