|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.mina.common.DefaultIoFuture
org.apache.mina.common.DefaultWriteFuture
public class DefaultWriteFuture
A default implementation of WriteFuture.
| Constructor Summary | |
|---|---|
DefaultWriteFuture(IoSession session)
Creates a new instance. |
|
| Method Summary | |
|---|---|
WriteFuture |
addListener(IoFutureListener<?> listener)
Adds an event listener which is notified when the state of this future changes. |
WriteFuture |
await()
Wait for the asynchronous operation to end. |
WriteFuture |
awaitUninterruptibly()
Wait for the asynchronous operation to end uninterruptibly. |
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,
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 which is notified when the state of this future changes. |
void |
setException(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. |
| Methods inherited from class org.apache.mina.common.DefaultIoFuture |
|---|
await, await, awaitUninterruptibly, awaitUninterruptibly, getSession, getValue, isReady, join, join, setValue |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.mina.common.IoFuture |
|---|
await, await, awaitUninterruptibly, awaitUninterruptibly, getSession, isReady, join, join |
| Constructor Detail |
|---|
public DefaultWriteFuture(IoSession session)
| Method Detail |
|---|
public static WriteFuture newWrittenFuture(IoSession session)
DefaultWriteFuture which is already marked as 'written'.
public static WriteFuture newNotWrittenFuture(IoSession session,
Throwable cause)
DefaultWriteFuture which is already marked as 'not written'.
public boolean isWritten()
WriteFuture
isWritten in interface WriteFuturepublic Throwable getException()
WriteFutureException. Otherwise,
null is returned.
getException in interface WriteFuturepublic void setWritten()
WriteFuture
setWritten in interface WriteFuturepublic void setException(Throwable exception)
WriteFuture
setException in interface WriteFuture
public WriteFuture await()
throws InterruptedException
IoFuture
await in interface IoFutureawait in interface WriteFutureawait in class DefaultIoFutureInterruptedExceptionpublic WriteFuture awaitUninterruptibly()
IoFuture
awaitUninterruptibly in interface IoFutureawaitUninterruptibly in interface WriteFutureawaitUninterruptibly in class DefaultIoFuturepublic WriteFuture addListener(IoFutureListener<?> listener)
IoFuture
addListener in interface IoFutureaddListener in interface WriteFutureaddListener in class DefaultIoFuturepublic WriteFuture removeListener(IoFutureListener<?> listener)
IoFuture
removeListener in interface IoFutureremoveListener in interface WriteFutureremoveListener in class DefaultIoFuture
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||