org.apache.mina.common.support
Class DefaultWriteFuture

java.lang.Object
  extended by org.apache.mina.common.support.DefaultIoFuture
      extended by org.apache.mina.common.support.DefaultWriteFuture
All Implemented Interfaces:
IoFuture, WriteFuture

public class DefaultWriteFuture
extends DefaultIoFuture
implements WriteFuture

A default implementation of WriteFuture.


Constructor Summary
DefaultWriteFuture(IoSession session)
          Creates a new instance.
DefaultWriteFuture(IoSession session, java.lang.Object lock)
          Creates a new instance which uses the specified object as a lock.
 
Method Summary
 boolean isWritten()
          Returns true if the write operation is finished successfully.
static WriteFuture newNotWrittenFuture(IoSession session)
          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'.
 void setWritten(boolean written)
          Sets whether the message is written or not, and notifies all threads waiting for this future.
 
Methods inherited from class org.apache.mina.common.support.DefaultIoFuture
addListener, getLock, getSession, getValue, isReady, join, join, removeListener, 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
addListener, getLock, getSession, isReady, join, join, removeListener
 

Constructor Detail

DefaultWriteFuture

public DefaultWriteFuture(IoSession session)
Creates a new instance.


DefaultWriteFuture

public DefaultWriteFuture(IoSession session,
                          java.lang.Object lock)
Creates a new instance which uses the specified object as a lock.

Method Detail

newWrittenFuture

public static WriteFuture newWrittenFuture(IoSession session)
Returns a new DefaultWriteFuture which is already marked as 'written'.


newNotWrittenFuture

public static WriteFuture newNotWrittenFuture(IoSession session)
Returns a new DefaultWriteFuture which is already marked as 'not written'.


isWritten

public boolean isWritten()
Description copied from interface: WriteFuture
Returns true if the write operation is finished successfully.

Specified by:
isWritten in interface WriteFuture

setWritten

public void setWritten(boolean written)
Description copied from interface: WriteFuture
Sets whether the message is written or not, and notifies all threads waiting for this future. This method is invoked by MINA internally. Please do not call this method directly.

Specified by:
setWritten in interface WriteFuture