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 IgniteAsyncSupport
protected T createAsyncInstance()
public boolean isAsync()
isAsync
in interface IgniteAsyncSupport
True
if asynchronous mode is enabled.public <R> IgniteFuture<R> future()
future
in interface IgniteAsyncSupport
public <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 Fabric : ver. 2.0.0 Release Date : April 30 2017