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.
|
java.lang.Throwable |
getException()
Returns the cause of the read failure if and only if the read
operation has failed due to an
Exception . |
java.lang.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(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)
public java.lang.Object getMessage()
ReadFuture
IoSession
has been closed.getMessage
in interface ReadFuture
public boolean isRead()
ReadFuture
isRead
in interface ReadFuture
public boolean isClosed()
ReadFuture
IoSession
associated with this
future has been closed.isClosed
in interface ReadFuture
public java.lang.Throwable getException()
ReadFuture
Exception
. Otherwise,
null is returned.getException
in interface ReadFuture
public void setClosed()
ReadFuture
IoSession
is closed. This method is invoked
by MINA internally. Please do not call this method directly.setClosed
in interface ReadFuture
public void setRead(java.lang.Object message)
ReadFuture
setRead
in interface ReadFuture
public void setException(java.lang.Throwable exception)
ReadFuture
setException
in interface ReadFuture
public ReadFuture await() throws java.lang.InterruptedException
DefaultIoFuture
await
in interface IoFuture
await
in interface ReadFuture
await
in class DefaultIoFuture
java.lang.InterruptedException
public ReadFuture awaitUninterruptibly()
DefaultIoFuture
awaitUninterruptibly
in interface IoFuture
awaitUninterruptibly
in interface ReadFuture
awaitUninterruptibly
in class DefaultIoFuture
public ReadFuture addListener(IoFutureListener<?> listener)
DefaultIoFuture
addListener
in interface IoFuture
addListener
in interface ReadFuture
addListener
in class DefaultIoFuture
public ReadFuture removeListener(IoFutureListener<?> listener)
DefaultIoFuture
removeListener
in interface IoFuture
removeListener
in interface ReadFuture
removeListener
in class DefaultIoFuture
Copyright © 2004-2019 Apache MINA Project. All Rights Reserved.