66676869707172737475
* Creates an {@link AsyncFutureTask} with the given * {@link Callable}. */ public AsyncFutureTask(Callable<V> callable) { if (callable == null) { throw new NullArgumentException("callable"); } this.callable = callable; }
62636465666768697071
/** * Creates an {@link AsyncExchanger} that uses the given lock Object */ public AsyncExchanger(Object lock) { if (lock == null) { throw new NullArgumentException("lock"); } this.lock = (lock != THIS) ? lock : this; }
206207208209210211212213214215216
/** * Sets the Exception that will be thrown by the get() method */ public boolean setException(E exception) { if (exception == null) { throw new NullArgumentException("exception"); } synchronized (lock) { if (done || cancelled) { return false;
7576777879808182838485
} @Override public void addAsyncFutureListener(AsyncFutureListener<V> listener) { if (listener == null) { throw new NullArgumentException("listener"); } boolean done = false; synchronized (this) {
111112113114115116117118119120121
} @Override public synchronized void removeAsyncFutureListener(AsyncFutureListener<V> listener) { if (listener == null) { throw new NullArgumentException("listener"); } if (first == listener) { if (before == null || before.isEmpty()) { first = null;