public class DefaultReadFuture extends DefaultIoFuture implements ReadFuture
WriteFuture
.构造器和说明 |
---|
DefaultReadFuture(IoSession session)
Creates a new instance.
|
限定符和类型 | 方法和说明 |
---|---|
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.
|
java.lang.Throwable |
getException() |
java.lang.Object |
getMessage()
Get the read message.
|
boolean |
isClosed() |
boolean |
isRead() |
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(java.lang.Throwable exception)
Sets the cause of the read failure, and notifies all threads waiting
for this future.
|
void |
setRead(java.lang.Object message)
Sets the message is written, and notifies all threads waiting for
this future.
|
await, await, awaitUninterruptibly, awaitUninterruptibly, getSession, getValue, isDone, join, join, setValue
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
await, await, awaitUninterruptibly, awaitUninterruptibly, getSession, isDone, join, join
public DefaultReadFuture(IoSession session)
session
- The associated sessionpublic java.lang.Object getMessage()
getMessage
在接口中 ReadFuture
IoSession
has been closed.public boolean isRead()
isRead
在接口中 ReadFuture
public boolean isClosed()
isClosed
在接口中 ReadFuture
IoSession
associated with this
future has been closed.public java.lang.Throwable getException()
getException
在接口中 ReadFuture
Exception
. Otherwise,
null is returned.public void setClosed()
IoSession
is closed. This method is invoked
by MINA internally. Please do not call this method directly.setClosed
在接口中 ReadFuture
public void setRead(java.lang.Object message)
setRead
在接口中 ReadFuture
message
- The received message to store in this futurepublic void setException(java.lang.Throwable exception)
setException
在接口中 ReadFuture
exception
- The exception to store in the Future instancepublic ReadFuture await() throws java.lang.InterruptedException
await
在接口中 IoFuture
await
在接口中 ReadFuture
await
在类中 DefaultIoFuture
java.lang.InterruptedException
- If the thread is interrupted while waitingpublic ReadFuture awaitUninterruptibly()
awaitUninterruptibly
在接口中 IoFuture
awaitUninterruptibly
在接口中 ReadFuture
awaitUninterruptibly
在类中 DefaultIoFuture
public ReadFuture addListener(IoFutureListener<?> listener)
addListener
在接口中 IoFuture
addListener
在接口中 ReadFuture
addListener
在类中 DefaultIoFuture
listener
- The listener to addpublic ReadFuture removeListener(IoFutureListener<?> listener)
removeListener
在接口中 IoFuture
removeListener
在接口中 ReadFuture
removeListener
在类中 DefaultIoFuture
listener
- The listener to remove