|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jboss.xnio.AbstractConvertingIoFuture<T,D>
T - the type of this future resultD - the type of the delegate resultpublic abstract class AbstractConvertingIoFuture<T,D>
An IoFuture implementation that wraps a different type of IoFuture. Used to create general wrappers
that convert one channel type to another.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.jboss.xnio.IoFuture |
|---|
IoFuture.HandlingNotifier<T,A>, IoFuture.Notifier<T,A>, IoFuture.Status |
| Field Summary | |
|---|---|
protected IoFuture<D> |
delegate
The delegate future result. |
| Constructor Summary | |
|---|---|
protected |
AbstractConvertingIoFuture(IoFuture<? extends D> delegate)
|
| 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,
java.util.concurrent.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,
java.util.concurrent.TimeUnit timeUnit)
Wait for the operation to complete, with a timeout. |
|
IoFuture<T> |
cancel()
Cancel an operation. |
|
protected abstract T |
convert(D arg)
|
|
T |
get()
Get the result of the operation. |
|
java.io.IOException |
getException()
Get the failure reason. |
|
T |
getInterruptibly()
Get the result of the operation. |
|
IoFuture.Status |
getStatus()
Get the current status. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final IoFuture<D> delegate
| Constructor Detail |
|---|
protected AbstractConvertingIoFuture(IoFuture<? extends D> delegate)
| Method Detail |
|---|
public IoFuture<T> cancel()
IoFuture
cancel in interface IoFuture<T>IoFuture instancepublic IoFuture.Status getStatus()
IoFuture
getStatus in interface IoFuture<T>public IoFuture.Status await()
IoFutureIoFuture.Status.WAITING.
await in interface IoFuture<T>
public IoFuture.Status await(long time,
java.util.concurrent.TimeUnit timeUnit)
IoFutureIoFuture.Status.WAITING,
or the given time elapses. If the time elapses before the operation is complete, IoFuture.Status.WAITING is
returned.
await in interface IoFuture<T>time - the amount of time to waittimeUnit - the time unit
IoFuture.Status.WAITING if the timeout expired
public IoFuture.Status awaitInterruptibly()
throws java.lang.InterruptedException
IoFutureIoFuture.Status.WAITING,
or the current thread is interrupted.
awaitInterruptibly in interface IoFuture<T>java.lang.InterruptedException - if the operation is interrupted
public IoFuture.Status awaitInterruptibly(long time,
java.util.concurrent.TimeUnit timeUnit)
throws java.lang.InterruptedException
IoFutureIoFuture.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.
awaitInterruptibly in interface IoFuture<T>time - the amount of time to waittimeUnit - the time unit
IoFuture.Status.WAITING if the timeout expired
java.lang.InterruptedException - if the operation is interrupted
public java.io.IOException getException()
throws java.lang.IllegalStateException
IoFuture
getException in interface IoFuture<T>java.lang.IllegalStateException - if the operation did not fail
public T get()
throws java.io.IOException
IoFuture
get in interface IoFuture<T>java.io.IOException - if the operation failed
public T getInterruptibly()
throws java.io.IOException,
java.lang.InterruptedException
IoFuture
getInterruptibly in interface IoFuture<T>java.io.IOException - if the operation failed
java.lang.InterruptedException - if the operation is interrupted
protected abstract T convert(D arg)
throws java.io.IOException
java.io.IOException
public <A> IoFuture<T> addNotifier(IoFuture.Notifier<T,A> notifier,
A attachment)
IoFuture
addNotifier in interface IoFuture<T>A - the attachment typenotifier - the notifier to be calledattachment - the attachment to pass in to the notifier
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||