public class GridNioFinishedFuture<R> extends Object implements GridNioFuture<R>
| Constructor and Description |
|---|
GridNioFinishedFuture(R res)
Constructs a future which
get() method will return a given result. |
GridNioFinishedFuture(Throwable err)
Constructs a future which
get() method will throw given exception. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
cancel()
Cancels this future.
|
R |
get()
Synchronously waits for completion of the operation and
returns operation result.
|
R |
get(long timeout)
Synchronously waits for completion of the operation for
up to the timeout specified and returns operation result.
|
R |
get(long timeout,
TimeUnit unit)
Synchronously waits for completion of the operation for
up to the timeout specified and returns operation result.
|
boolean |
isCancelled()
Returns
true if this operation was cancelled before it completed normally. |
boolean |
isDone()
Checks if operation is done.
|
void |
listenAsync(IgniteInClosure<? super GridNioFuture<R>> lsnr)
Registers listener closure to be asynchronously notified whenever future completes.
|
boolean |
messageThread() |
void |
messageThread(boolean msgThread)
Sets flag indicating that message send future was created in thread that was processing a message.
|
boolean |
skipRecovery() |
public GridNioFinishedFuture(R res)
get() method will return a given result.res - Future result.public R get() throws IOException, IgniteCheckedException
get in interface GridNioFuture<R>IOException - If IOException occurred while performing operation.IgniteInterruptedCheckedException - Subclass of IgniteCheckedException thrown if the wait was interrupted.IgniteFutureCancelledCheckedException - Subclass of IgniteCheckedException throws if operation was cancelled.IgniteCheckedException - If operation failed.public R get(long timeout) throws IOException, IgniteCheckedException
get(long, TimeUnit.MILLISECONDS).get in interface GridNioFuture<R>timeout - The maximum time to wait in milliseconds.IOException - If IOException occurred while performing operation.IgniteInterruptedCheckedException - Subclass of IgniteCheckedException thrown if the wait was interrupted.IgniteFutureTimeoutCheckedException - Subclass of IgniteCheckedException thrown if the wait was timed out.IgniteFutureCancelledCheckedException - Subclass of IgniteCheckedException throws if operation was cancelled.IgniteCheckedException - If operation failed.public R get(long timeout, TimeUnit unit) throws IOException, IgniteCheckedException
get in interface GridNioFuture<R>timeout - The maximum time to wait.unit - The time unit of the timeout argument.IOException - If IOException occurred while performing operation.IgniteInterruptedCheckedException - Subclass of IgniteCheckedException thrown if the wait was interrupted.IgniteFutureTimeoutCheckedException - Subclass of IgniteCheckedException thrown if the wait was timed out.IgniteFutureCancelledCheckedException - Subclass of IgniteCheckedException throws if operation was cancelled.IgniteCheckedException - If operation failed.public boolean cancel()
throws IgniteCheckedException
cancel in interface GridNioFuture<R>True if future was canceled (i.e. was not finished prior to this call).IgniteCheckedException - If cancellation failed.public boolean isDone()
isDone in interface GridNioFuture<R>True if operation is done, false otherwise.public boolean isCancelled()
true if this operation was cancelled before it completed normally.isCancelled in interface GridNioFuture<R>True if this operation was cancelled before it completed normally.public void listenAsync(@Nullable IgniteInClosure<? super GridNioFuture<R>> lsnr)
listenAsync in interface GridNioFuture<R>lsnr - Listener closure to register. If not provided - this method is no-op.public void messageThread(boolean msgThread)
messageThread in interface GridNioFuture<R>msgThread - True if future was created in thread that is processing message.public boolean messageThread()
messageThread in interface GridNioFuture<R>True if future was created in thread that was processing message.public boolean skipRecovery()
skipRecovery in interface GridNioFuture<R>True if skip recovery for this operation.
Follow @ApacheIgnite
Ignite Fabric : ver. 1.0.0-RC1 Release Date : February 17 2015