org.apache.mina.common

Class IoFilter.WriteRequest

Enclosing Class:
IoFilter

public static class IoFilter.WriteRequest
extends java.lang.Object

Represents write request fired by IoSession.write(Object).

Constructor Summary

WriteRequest(Object message)
Creates a new instance without WriteFuture.
WriteRequest(Object message, WriteFuture future)
Creates a new instance with WriteFuture.
WriteRequest(Object message, WriteFuture future, SocketAddress destination)
Creates a new instance.

Method Summary

@Override
String toString()
SocketAddress
getDestination()
Returne 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.

Constructor Details

WriteRequest

public WriteRequest(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.

WriteRequest

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

WriteRequest

public WriteRequest(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 Details

String toString

public @Override String toString()

getDestination

public SocketAddress getDestination()
Returne the destination of this write request.
Returns:
null for the default destination

getFuture

public WriteFuture getFuture()
Returns WriteFuture that is associated with this write request.

getMessage

public Object getMessage()
Returns a message object to be written.