Modifier and Type | Field and Description |
---|---|
(package private) CountDownLatch |
latch |
(package private) Object |
val |
Constructor and Description |
---|
DataFlowVariable() |
DataFlowVariable(CountDownLatch latch) |
Modifier and Type | Method and Description |
---|---|
void |
bind(Object val)
The method will bind the incoming value to the value in the class and
then do a countDown on the latch.
|
Object |
getVal()
This method blocks till the count down latch has reset to 0.
|
Object |
getVal(long waitTime,
TimeUnit timeUnit)
This method blocks for a specified amount of time to retrieve the value
bound in bind method.
|
final CountDownLatch latch
Object val
public DataFlowVariable()
public DataFlowVariable(CountDownLatch latch)
public void bind(Object val)
val
- public Object getVal() throws InterruptedException
InterruptedException
public Object getVal(long waitTime, TimeUnit timeUnit) throws InterruptedException
waitTime
- the amount of time to waittimeUnit
- the unit, milliseconds, seconds etc.InterruptedException
Copyright © 2013. All Rights Reserved.