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 java.util.concurrent.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.
Methods inherited from class java.util.concurrent.CountDownLatch |
getCount |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
BusAwareCountDownLatch
public BusAwareCountDownLatch(int count,
IComponentBus bus)
BusAwareCountDownLatch
public BusAwareCountDownLatch(int count,
IComponentBus bus,
IComponent... components)
BusAwareCountDownLatch
public BusAwareCountDownLatch(int count,
IComponentBus bus,
IToken... componentIds)
countDown
public void countDown()
- Overrides:
countDown
in class java.util.concurrent.CountDownLatch
await
public void await()
throws BusAwareCountDownLatch.BusStoppedInterruptedException,
PogamutInterruptedException
- Overrides:
await
in class java.util.concurrent.CountDownLatch
- Throws:
BusAwareCountDownLatch.BusStoppedInterruptedException
- when the waiting was stopped because some component of the bus stopped
PogamutInterruptedException
await
public boolean await(long timeout,
java.util.concurrent.TimeUnit unit)
throws BusAwareCountDownLatch.BusStoppedInterruptedException,
PogamutInterruptedException
- Overrides:
await
in class java.util.concurrent.CountDownLatch
- Parameters:
timeout
- unit
-
- Returns:
-
- Throws:
BusAwareCountDownLatch.BusStoppedInterruptedException
- when the waiting was stopped because some component of the bus stopped
PogamutInterruptedException
checkBusStop
protected void checkBusStop()
throws BusAwareCountDownLatch.BusStoppedInterruptedException
- Throws:
BusAwareCountDownLatch.BusStoppedInterruptedException
toString
public java.lang.String toString()
- Overrides:
toString
in class java.util.concurrent.CountDownLatch