@Test public void testMultipleSetFuture() { slFuture.setFuture(lfMock); slFuture.setFuture(lfMock); }
public synchronized ListenableFuture<T> setFuture(ListenableFuture<T> listenableFuture) { if (future == null && !isDone()) { future = Preconditions.checkNotNull(listenableFuture); for (ListenerTuple listenerTuple : listeners) { Preconditions.checkNotNull(listenableFuture) .addListener(listenerTuple.listener, listenerTuple.executor); } } return this; }
SettableListenableFuture implements ListenableFuture<T> { public synchronized ListenableFuture<T> setFuture(ListenableFuture<T> listenableFuture) { if (future == null && !isDone()) { future = Preconditions.checkNotNull(listenableFuture); for (ListenerTuple listenerTuple : listeners) { Preconditions.checkNotNull(listenableFuture) .addListener(listenerTuple.listener, listenerTuple.executor); } } return this; } }
SettableListenableFuture implements ListenableFuture<T> { public synchronized ListenableFuture<T> setFuture(ListenableFuture<T> listenableFuture) { if (future == null && !isDone()) { future = Preconditions.checkNotNull(listenableFuture); for (ListenerTuple listenerTuple : listeners) { Preconditions.checkNotNull(listenableFuture) .addListener(listenerTuple.listener, listenerTuple.executor); } } return this; } SettableListenableFuture(Callable<T> task, ListeningExecutorService executor); }
SettableListenableFuture implements ListenableFuture<T> { public synchronized ListenableFuture<T> setFuture(ListenableFuture<T> listenableFuture) { if (future == null && !isDone()) { future = Preconditions.checkNotNull(listenableFuture); for (ListenerTuple listenerTuple : listeners) { Preconditions.checkNotNull(listenableFuture) .addListener(listenerTuple.listener, listenerTuple.executor); } } return this; } SettableListenableFuture(Callable<T> task, ListeningExecutorService executor); @Override synchronized void addListener(Runnable listener, Executor executor); @Override synchronized boolean cancel(boolean b); @Override synchronized boolean isCancelled(); @Override synchronized boolean isDone(); @Override synchronized T get(); @Override synchronized T get(long l, TimeUnit timeUnit); synchronized Callable<T> getTask(); synchronized ListeningExecutorService getExecutor(); synchronized ListenableFuture<T> setFuture(ListenableFuture<T> listenableFuture); }
SettableListenableFuture implements ListenableFuture<T> { public synchronized ListenableFuture<T> setFuture(ListenableFuture<T> listenableFuture) { if (future == null && !isDone()) { future = Preconditions.checkNotNull(listenableFuture); for (ListenerTuple listenerTuple : listeners) { Preconditions.checkNotNull(listenableFuture) .addListener(listenerTuple.listener, listenerTuple.executor); } } return this; } SettableListenableFuture(Callable<T> task, ListeningExecutorService executor); @Override synchronized void addListener(Runnable listener, Executor executor); @Override synchronized boolean cancel(boolean b); @Override synchronized boolean isCancelled(); @Override synchronized boolean isDone(); @Override synchronized T get(); @Override synchronized T get(long l, TimeUnit timeUnit); synchronized Callable<T> getTask(); synchronized ListeningExecutorService getExecutor(); synchronized ListenableFuture<T> setFuture(ListenableFuture<T> listenableFuture);  }