public class DefaultWriteFuture extends DefaultIoFuture implements WriteFuture
WriteFuture
.Constructor and Description |
---|
DefaultWriteFuture(IoSession session)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
WriteFuture |
addListener(IoFutureListener<?> listener)
Adds an event listener which is notified when
this future is completed.
|
WriteFuture |
await()
Wait for the asynchronous operation to complete.
|
WriteFuture |
awaitUninterruptibly()
Wait for the asynchronous operation to complete uninterruptibly.
|
java.lang.Throwable |
getException()
Returns the cause of the write failure if and only if the write
operation has failed due to an
Exception . |
boolean |
isWritten()
Returns true if the write operation is finished successfully.
|
static WriteFuture |
newNotWrittenFuture(IoSession session,
java.lang.Throwable cause)
Returns a new
DefaultWriteFuture which is already marked as 'not written'. |
static WriteFuture |
newWrittenFuture(IoSession session)
Returns a new
DefaultWriteFuture which is already marked as 'written'. |
WriteFuture |
removeListener(IoFutureListener<?> listener)
Removes an existing event listener so it won't be notified when
the future is completed.
|
void |
setException(java.lang.Throwable exception)
Sets the cause of the write failure, and notifies all threads waiting
for this future.
|
void |
setWritten()
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 DefaultWriteFuture(IoSession session)
public static WriteFuture newWrittenFuture(IoSession session)
DefaultWriteFuture
which is already marked as 'written'.public static WriteFuture newNotWrittenFuture(IoSession session, java.lang.Throwable cause)
DefaultWriteFuture
which is already marked as 'not written'.public boolean isWritten()
isWritten
in interface WriteFuture
public java.lang.Throwable getException()
Exception
. Otherwise,
null is returned.getException
in interface WriteFuture
public void setWritten()
setWritten
in interface WriteFuture
public void setException(java.lang.Throwable exception)
setException
in interface WriteFuture
public WriteFuture await() throws java.lang.InterruptedException
await
in interface IoFuture
await
in interface WriteFuture
await
in class DefaultIoFuture
WriteFuture
java.lang.InterruptedException
public WriteFuture awaitUninterruptibly()
awaitUninterruptibly
in interface IoFuture
awaitUninterruptibly
in interface WriteFuture
awaitUninterruptibly
in class DefaultIoFuture
public WriteFuture addListener(IoFutureListener<?> listener)
addListener
in interface IoFuture
addListener
in interface WriteFuture
addListener
in class DefaultIoFuture
public WriteFuture removeListener(IoFutureListener<?> listener)
removeListener
in interface IoFuture
removeListener
in interface WriteFuture
removeListener
in class DefaultIoFuture
Copyright © 2004-2019 Apache MINA Project. All Rights Reserved.