public class GridClientFutureAdapter<R> extends AbstractQueuedSynchronizer implements GridClientFuture<R>
AbstractQueuedSynchronizer.ConditionObject| Constructor and Description |
|---|
GridClientFutureAdapter()
Creates not-finished future without any result.
|
GridClientFutureAdapter(R res)
Creates succeeded finished future with given result.
|
GridClientFutureAdapter(Throwable err)
Creates failed finished future with given error.
|
| Modifier and Type | Method and Description |
|---|---|
<T> GridClientFutureAdapter<T> |
chain(GridClientFutureCallback<R,T> cb)
Creates future's chain and completes chained future, when this future finishes.
|
R |
get()
Synchronously waits for completion and returns result.
|
R |
get(long timeout,
TimeUnit unit)
Synchronously waits for completion and returns result.
|
boolean |
isDone()
Checks if future is done.
|
void |
listen(GridClientFutureListener<R>... lsnrs)
Register new listeners for notification when future completes.
|
void |
onDone(R res)
Callback to notify that future is finished successfully.
|
void |
onDone(Throwable err)
Callback to notify that future is finished with error.
|
protected int |
tryAcquireShared(int ignore) |
protected boolean |
tryReleaseShared(int ignore) |
acquire, acquireInterruptibly, acquireShared, acquireSharedInterruptibly, compareAndSetState, getExclusiveQueuedThreads, getFirstQueuedThread, getQueuedThreads, getQueueLength, getSharedQueuedThreads, getState, getWaitingThreads, getWaitQueueLength, hasContended, hasQueuedPredecessors, hasQueuedThreads, hasWaiters, isHeldExclusively, isQueued, owns, release, releaseShared, setState, toString, tryAcquire, tryAcquireNanos, tryAcquireSharedNanos, tryReleasegetExclusiveOwnerThread, setExclusiveOwnerThreadpublic GridClientFutureAdapter()
public GridClientFutureAdapter(R res)
res - Future result.public GridClientFutureAdapter(Throwable err)
err - Future error.public R get() throws GridClientException
get in interface GridClientFuture<R>GridClientException - In case of error.public R get(long timeout, TimeUnit unit) throws GridClientException
get in interface GridClientFuture<R>timeout - Timeout interval to wait future completes.unit - Timeout interval unit to wait future completes.GridClientException - In case of error.GridClientFutureTimeoutException - If timed out before future finishes.public boolean isDone()
isDone in interface GridClientFuture<R>public void onDone(@Nullable
R res)
res - Result (can be null).public void onDone(Throwable err)
err - Error (can't be null).protected final int tryAcquireShared(int ignore)
tryAcquireShared in class AbstractQueuedSynchronizerprotected final boolean tryReleaseShared(int ignore)
tryReleaseShared in class AbstractQueuedSynchronizerpublic void listen(GridClientFutureListener<R>... lsnrs)
listen in interface GridClientFuture<R>lsnrs - Listeners to be registered.public <T> GridClientFutureAdapter<T> chain(GridClientFutureCallback<R,T> cb)
T - New future format to convert this finished future to.cb - Future callback to convert this future result into expected format.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.9.0 Release Date : October 15 2020