|
XNIO version 1.2.0.GA | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
T - the type of result that this operation producespublic interface IoFuture<T>

The future result of an asynchronous request. Use instances of this interface to retrieve the final status of an asynchronous operation.
| Nested Class Summary | |
|---|---|
static class |
IoFuture.HandlingNotifier<T,A>
A base notifier class that calls the designated handler method on notification. |
static interface |
IoFuture.Notifier<T,A>
A notifier that handles changes in the status of an IoFuture. |
static class |
IoFuture.Status
The current status of an asynchronous operation. |
| Method Summary | ||
|---|---|---|
|
addNotifier(IoFuture.Notifier<T,A> notifier,
A attachment)
Add a notifier to be called when this operation is complete. |
|
IoFuture.Status |
await()
Wait for the operation to complete. |
|
IoFuture.Status |
await(long time,
TimeUnit timeUnit)
Wait for the operation to complete, with a timeout. |
|
IoFuture.Status |
awaitInterruptibly()
Wait for the operation to complete. |
|
IoFuture.Status |
awaitInterruptibly(long time,
TimeUnit timeUnit)
Wait for the operation to complete, with a timeout. |
|
IoFuture<T> |
cancel()
Cancel an operation. |
|
T |
get()
Get the result of the operation. |
|
IOException |
getException()
Get the failure reason. |
|
T |
getInterruptibly()
Get the result of the operation. |
|
IoFuture.Status |
getStatus()
Get the current status. |
|
| Method Detail |
|---|
IoFuture<T> cancel()
IoFuture instanceIoFuture.Status getStatus()
IoFuture.Status await()
IoFuture.Status.WAITING.
IoFuture.Status await(long time,
TimeUnit timeUnit)
IoFuture.Status.WAITING,
or the given time elapses. If the time elapses before the operation is complete, IoFuture.Status.WAITING is
returned.
time - the amount of time to waittimeUnit - the time unit
IoFuture.Status.WAITING if the timeout expired
IoFuture.Status awaitInterruptibly()
throws InterruptedException
IoFuture.Status.WAITING,
or the current thread is interrupted.
InterruptedException - if the operation is interrupted
IoFuture.Status awaitInterruptibly(long time,
TimeUnit timeUnit)
throws InterruptedException
IoFuture.Status.WAITING,
the given time elapses, or the current thread is interrupted. If the time elapses before the operation is complete, IoFuture.Status.WAITING is
returned.
time - the amount of time to waittimeUnit - the time unit
IoFuture.Status.WAITING if the timeout expired
InterruptedException - if the operation is interrupted
T get()
throws IOException,
CancellationException
IOException - if the operation failed
CancellationException - if the operation was cancelled
T getInterruptibly()
throws IOException,
InterruptedException,
CancellationException
IOException - if the operation failed
InterruptedException - if the operation is interrupted
CancellationException - if the operation was cancelled
IOException getException()
throws IllegalStateException
IllegalStateException - if the operation did not fail
<A> IoFuture<T> addNotifier(IoFuture.Notifier<T,A> notifier,
A attachment)
A - the attachment typenotifier - the notifier to be calledattachment - the attachment to pass in to the notifier
|
XNIO version 1.2.0.GA | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||