org.apache.mina.core.write

## Class DefaultWriteRequest

- java.lang.Object
- - org.apache.mina.core.write.DefaultWriteRequest

- All Implemented Interfaces:
    WriteRequest

      public class DefaultWriteRequest
      extends Object
      implements WriteRequest

  The default implementation of `WriteRequest`.
  Author:
    Apache MINA Project

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `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

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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`.
    `boolean` | `isEncoded()` Tells if the current message has been encoded
    `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`

    - #### isEncoded

          public boolean isEncoded()

      Description copied from interface: `WriteRequest`
      Tells if the current message has been encoded
      Specified by:
        `isEncoded` in interface `WriteRequest`
      Returns:
        true if the message has already been encoded

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