|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface WriteFuture
An IoFuture for asynchronous write requests.
IoSession session = ...;
WriteFuture future = session.write(...);
// Wait until the message is completely written out to the O/S buffer.
future.join();
if( future.isWritten() )
{
// The message has been written successfully.
}
else
{
// The messsage couldn't be written out completely for some reason.
// (e.g. Connection is closed)
}
| Method Summary | |
|---|---|
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. |
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. |
WriteFuture |
removeListener(IoFutureListener<?> listener)
Removes an existing event listener so it won't be notified when the future is completed. |
void |
setException(Throwable cause)
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 interface org.apache.mina.core.future.IoFuture |
|---|
await, await, awaitUninterruptibly, awaitUninterruptibly, getSession, isDone, join, join |
| Method Detail |
|---|
boolean isWritten()
Throwable getException()
Exception. Otherwise,
null is returned.
void setWritten()
void setException(Throwable cause)
WriteFuture await()
throws InterruptedException
await in interface IoFutureWriteFuture
InterruptedExceptionWriteFuture awaitUninterruptibly()
awaitUninterruptibly in interface IoFutureWriteFuture addListener(IoFutureListener<?> listener)
addListener in interface IoFutureWriteFuture removeListener(IoFutureListener<?> listener)
removeListener in interface IoFuture
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||