com.kuka.common.concurrent
Class CountDownLatchWaitToken

java.lang.Object
  extended by com.kuka.common.concurrent.CountDownLatchWaitToken
All Implemented Interfaces:
IWaitToken

public final class CountDownLatchWaitToken
extends Object
implements IWaitToken

Publishable (immutable) wait token for a CountDownLatch.

This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

Constructor Summary
CountDownLatchWaitToken(CountDownLatch latch)
          Creates a new wait token for the given CountDownLatch.
 
Method Summary
 void await()
          Blocks the calling thread until the state becomes finished.
 void await(long timeout, TimeUnit unit)
          Blocks the calling thread until the state becomes finished or the timeout elapses.
 boolean isFinished()
          Checks if the state is already finished.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CountDownLatchWaitToken

public CountDownLatchWaitToken(CountDownLatch latch)
Creates a new wait token for the given CountDownLatch.

Parameters:
latch - the latch
Throws:
NullPointerException - if argument is null
Method Detail

await

public void await()
Description copied from interface: IWaitToken
Blocks the calling thread until the state becomes finished.

Specified by:
await in interface IWaitToken

await

public void await(long timeout,
                  TimeUnit unit)
           throws TimeoutException
Description copied from interface: IWaitToken
Blocks the calling thread until the state becomes finished or the timeout elapses.

Specified by:
await in interface IWaitToken
Parameters:
timeout - The timeout.
unit - The unit of the timeout.
Throws:
TimeoutException - the wait timed out

isFinished

public boolean isFinished()
Description copied from interface: IWaitToken
Checks if the state is already finished.

Specified by:
isFinished in interface IWaitToken
Returns:
true if finished, otherwise false.


Copyright © 2019. All rights reserved.