com.atlassian.bamboo.concurrent
Class CalculatingBlockingReference<T>

java.lang.Object
  extended by com.atlassian.bamboo.concurrent.CalculatingBlockingReference<T>

public class CalculatingBlockingReference<T>
extends java.lang.Object

Retrieves a reference from a supplier. If $Supplier.get() method is currently NOT being executed, it is called to provide a value to return. Otherwise, instead of running parallel computations, the calling threads will wait until the current computation is completed. Then, they'll all get the same value from the originally running calculation.


Constructor Summary
CalculatingBlockingReference(com.atlassian.util.concurrent.Supplier<T> supplier)
           
 
Method Summary
 T get()
           
static
<T> CalculatingBlockingReference<T>
make(com.atlassian.util.concurrent.Supplier<T> supplier)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CalculatingBlockingReference

public CalculatingBlockingReference(com.atlassian.util.concurrent.Supplier<T> supplier)
Method Detail

get

public T get()
      throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException

make

public static <T> CalculatingBlockingReference<T> make(com.atlassian.util.concurrent.Supplier<T> supplier)


Copyright © 2013 Atlassian Software Systems Pty Ltd. All Rights Reserved.