public class DefaultReadFuture extends DefaultIoFuture implements ReadFuture
WriteFuture.| Constructor and Description |
|---|
DefaultReadFuture(IoSession session)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
ReadFuture |
addListener(IoFutureListener<?> listener)
Adds an event listener which is notified when
this future is completed.
|
ReadFuture |
await()
Wait for the asynchronous operation to complete.
|
ReadFuture |
awaitUninterruptibly()
Wait for the asynchronous operation to complete uninterruptibly.
|
Throwable |
getException()
Returns the cause of the read failure if and only if the read
operation has failed due to an
Exception. |
Object |
getMessage()
Returns the received message.
|
boolean |
isClosed()
Returns true if the
IoSession associated with this
future has been closed. |
boolean |
isRead()
Returns true if a message was received successfully.
|
ReadFuture |
removeListener(IoFutureListener<?> listener)
Removes an existing event listener so it won't be notified when
the future is completed.
|
void |
setClosed()
Sets the associated
IoSession is closed. |
void |
setException(Throwable exception)
Sets the cause of the read failure, and notifies all threads waiting
for this future.
|
void |
setRead(Object message)
Sets the message is written, and notifies all threads waiting for
this future.
|
await, await, awaitUninterruptibly, awaitUninterruptibly, getSession, getValue, isDone, join, join, setValueclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitawait, await, awaitUninterruptibly, awaitUninterruptibly, getSession, isDone, join, joinpublic DefaultReadFuture(IoSession session)
public Object getMessage()
ReadFutureIoSession has been closed.getMessage in interface ReadFuturepublic boolean isRead()
ReadFutureisRead in interface ReadFuturepublic boolean isClosed()
ReadFutureIoSession associated with this
future has been closed.isClosed in interface ReadFuturepublic Throwable getException()
ReadFutureException. Otherwise,
null is returned.getException in interface ReadFuturepublic void setClosed()
ReadFutureIoSession is closed. This method is invoked
by MINA internally. Please do not call this method directly.setClosed in interface ReadFuturepublic void setRead(Object message)
ReadFuturesetRead in interface ReadFuturepublic void setException(Throwable exception)
ReadFuturesetException in interface ReadFuturepublic ReadFuture await() throws InterruptedException
DefaultIoFutureawait in interface IoFutureawait in interface ReadFutureawait in class DefaultIoFutureInterruptedExceptionpublic ReadFuture awaitUninterruptibly()
DefaultIoFutureawaitUninterruptibly in interface IoFutureawaitUninterruptibly in interface ReadFutureawaitUninterruptibly in class DefaultIoFuturepublic ReadFuture addListener(IoFutureListener<?> listener)
DefaultIoFutureaddListener in interface IoFutureaddListener in interface ReadFutureaddListener in class DefaultIoFuturepublic ReadFuture removeListener(IoFutureListener<?> listener)
DefaultIoFutureremoveListener in interface IoFutureremoveListener in interface ReadFutureremoveListener in class DefaultIoFuture