public class AsyncSupportAdapter<T extends IgniteAsyncSupport> extends Object implements IgniteAsyncSupport
IgniteAsyncSupport.| Modifier and Type | Field and Description |
|---|---|
protected ThreadLocal<IgniteFuture<?>> |
curFut
Future for previous asynchronous operation.
|
| Constructor and Description |
|---|
AsyncSupportAdapter()
Default constructor.
|
AsyncSupportAdapter(boolean async) |
| Modifier and Type | Method and Description |
|---|---|
protected T |
createAsyncInstance()
Creates component with asynchronous mode enabled.
|
protected <R> IgniteFuture<R> |
createFuture(IgniteInternalFuture<R> fut) |
<R> IgniteFuture<R> |
future()
Gets and resets future for previous asynchronous operation.
|
<R> IgniteFuture<R> |
future(boolean reset)
Gets and optionally resets future for previous asynchronous operation.
|
boolean |
isAsync() |
<R> R |
saveOrGet(IgniteInternalFuture<R> fut) |
T |
withAsync()
Gets instance of this component with asynchronous mode enabled.
|
protected ThreadLocal<IgniteFuture<?>> curFut
public AsyncSupportAdapter()
public AsyncSupportAdapter(boolean async)
async - Async enabled flag.public T withAsync()
withAsync in interface IgniteAsyncSupportprotected T createAsyncInstance()
public boolean isAsync()
isAsync in interface IgniteAsyncSupportTrue if asynchronous mode is enabled.public <R> IgniteFuture<R> future()
future in interface IgniteAsyncSupportpublic <R> IgniteFuture<R> future(boolean reset)
reset - Specifies whether to reset future.public <R> R saveOrGet(IgniteInternalFuture<R> fut) throws IgniteCheckedException
fut - Future.null,
otherwise waits for future and returns result.IgniteCheckedException - If asynchronous mode is disabled and future failed.protected <R> IgniteFuture<R> createFuture(IgniteInternalFuture<R> fut)
fut - Internal future.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.8.0 Release Date : February 27 2020