| org.apache.mina.common.ReadFuture
All known Subclasses: org.apache.mina.common.DefaultReadFuture,
ReadFuture | public interface ReadFuture extends IoFuture(Code) | | An
IoFuture for
IoSession.read asynchronous read requests .
Example
IoSession session = ...;
// useReadOperation must be enabled to use read operation.
session.getConfig().setUseReadOperation(true);
ReadFuture future = session.read();
// Wait until a message is received.
future.await();
try {
Object message = future.getMessage();
} catch (Exception e) {
...
}
author: The Apache MINA Project (dev@mina.apache.org) version: $Rev: 594477 $, $Date: 2007-11-13 03:42:03 -0700 (Tue, 13 Nov 2007) $ |
getException | Throwable getException()(Code) | | Returns the cause of the read failure if and only if the read
operation has failed due to an
Exception . Otherwise,
null is returned.
|
getMessage | Object getMessage()(Code) | | Returns the received message. It returns null if this
future is not ready or the associated
IoSession has been closed.
throws: RuntimeException - if read or any relevant operation has failed. |
isClosed | boolean isClosed()(Code) | | Returns true if the
IoSession associated with this
future has been closed.
|
isRead | boolean isRead()(Code) | | Returns true if a message was received successfully.
|
setClosed | void setClosed()(Code) | | Sets the associated
IoSession is closed. This method is invoked
by MINA internally. Please do not call this method directly.
|
setException | void setException(Throwable cause)(Code) | | Sets the cause of the read failure, and notifies all threads waiting
for this future. This method is invoked by MINA internally. Please
do not call this method directly.
|
setRead | void setRead(Object message)(Code) | | Sets the message is written, and notifies all threads waiting for
this future. This method is invoked by MINA internally. Please do
not call this method directly.
|
|
|