org.apache.mina.core.write
Class DefaultWriteRequest

java.lang.Object
  extended by org.apache.mina.core.write.DefaultWriteRequest
All Implemented Interfaces:
WriteRequest

public class DefaultWriteRequest
extends Object
implements WriteRequest

The default implementation of WriteRequest.

Version:
$Rev:671827 $, $Date:2008-06-26 09:49:48 +0100 (jeu., 26 juin 2008) $
Author:
The Apache MINA Project (dev@mina.apache.org)

Constructor Summary
DefaultWriteRequest(Object message)
          Creates a new instance without WriteFuture.
DefaultWriteRequest(Object message, WriteFuture future)
          Creates a new instance with WriteFuture.
DefaultWriteRequest(Object message, WriteFuture future, SocketAddress destination)
          Creates a new instance.
 
Method Summary
 SocketAddress getDestination()
          Returns the destination of this write request.
 WriteFuture getFuture()
          Returns WriteFuture that is associated with this write request.
 Object getMessage()
          Returns a message object to be written.
 WriteRequest getOriginalRequest()
          Returns the WriteRequest which was requested originally, which is not transformed by any IoFilter.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultWriteRequest

public DefaultWriteRequest(Object message)
Creates a new instance without WriteFuture. You'll get an instance of WriteFuture even if you called this constructor because getFuture() will return a bogus future.


DefaultWriteRequest

public DefaultWriteRequest(Object message,
                           WriteFuture future)
Creates a new instance with WriteFuture.


DefaultWriteRequest

public DefaultWriteRequest(Object message,
                           WriteFuture future,
                           SocketAddress destination)
Creates a new instance.

Parameters:
message - a message to write
future - a future that needs to be notified when an operation is finished
destination - the destination of the message. This property will be ignored unless the transport supports it.
Method Detail

getFuture

public WriteFuture getFuture()
Description copied from interface: WriteRequest
Returns WriteFuture that is associated with this write request.

Specified by:
getFuture in interface WriteRequest

getMessage

public Object getMessage()
Description copied from interface: WriteRequest
Returns a message object to be written.

Specified by:
getMessage in interface WriteRequest

getOriginalRequest

public WriteRequest getOriginalRequest()
Description copied from interface: WriteRequest
Returns the WriteRequest which was requested originally, which is not transformed by any IoFilter.

Specified by:
getOriginalRequest in interface WriteRequest

getDestination

public SocketAddress getDestination()
Description copied from interface: WriteRequest
Returns the destination of this write request.

Specified by:
getDestination in interface WriteRequest
Returns:
null for the default destination

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2004-2008 Apache MINA Project. All Rights Reserved.