org.crsh.util
Class LatchedFuture<V>
java.lang.Object
org.crsh.util.LatchedFuture<V>
- All Implemented Interfaces:
- Future<V>
public class LatchedFuture<V>
- extends Object
- implements Future<V>
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
value
private V value
- .
latch
private final CountDownLatch latch
- .
lock
private final Lock lock
- .
listener
private FutureListener<V> listener
- The optional listener.
LatchedFuture
public LatchedFuture()
LatchedFuture
public LatchedFuture(V value)
cancel
public boolean cancel(boolean b)
- Specified by:
cancel
in interface Future<V>
isCancelled
public boolean isCancelled()
- Specified by:
isCancelled
in interface Future<V>
isDone
public boolean isDone()
- Specified by:
isDone
in interface Future<V>
get
public V get()
throws InterruptedException,
ExecutionException
- Specified by:
get
in interface Future<V>
- Throws:
InterruptedException
ExecutionException
get
public V get(long l,
TimeUnit timeUnit)
throws InterruptedException,
ExecutionException,
TimeoutException
- Specified by:
get
in interface Future<V>
- Throws:
InterruptedException
ExecutionException
TimeoutException
addListener
public void addListener(FutureListener<V> listener)
set
public void set(V value)
Copyright © 2014 eXo Platform SAS. All Rights Reserved.