Class WriteResult<K,L>

java.lang.Object
org.glassfish.grizzly.WriteResult<K,L>
Type Parameters:
K - type of the message
L - type of the address
All Implemented Interfaces:
Cacheable, Copyable, Result
Direct Known Subclasses:
RecordWriteResult

public class WriteResult<K,L> extends Object implements Result, Cacheable
Result of write operation, returned by Writeable.
Author:
Alexey Stashok
  • Constructor Details

    • WriteResult

      protected WriteResult()
  • Method Details

    • create

      public static <K, L> WriteResult<K,L> create(Connection<L> connection)
    • create

      public static <K, L> WriteResult<K,L> create(Connection<L> connection, K message, L dstAddress, long writeSize)
    • getConnection

      public final Connection<L> getConnection()
      Get the Connection data were read from.
      Specified by:
      getConnection in interface Result
      Returns:
      the Connection data were read from.
    • getMessage

      public final K getMessage()
      Get the message, which was read.
      Returns:
      the message, which was read.
    • setMessage

      public final void setMessage(K message)
      Set the message, which was read.
      Parameters:
      message - the message, which was read.
    • getDstAddress

      public final L getDstAddress()
      Get the destination address, the message was written to.
      Returns:
      the destination address, the message was written to.
    • getDstAddressHolder

      public final Holder<L> getDstAddressHolder()
      Get the destination address, the message was written to.
      Returns:
      the destination address, the message was written to.
    • setDstAddress

      public final void setDstAddress(L dstAddress)
      Set the destination address, the message was written to.
      Parameters:
      dstAddress - the destination address, the message was written to.
    • setDstAddressHolder

      public final void setDstAddressHolder(Holder<L> dstAddressHolder)
      Set the destination address, the message was written to.
      Parameters:
      dstAddressHolder - the destination address, the message was written to.
    • getWrittenSize

      public final long getWrittenSize()
      Get the number of bytes, which were written.
      Returns:
      the number of bytes, which were written.
    • setWrittenSize

      public final void setWrittenSize(long writeSize)
      Set the number of bytes, which were written.
      Parameters:
      writeSize - the number of bytes, which were written.
    • set

      protected void set(Connection<L> connection, K message, L dstAddress, long writtenSize)
      One method to set all the WriteResult properties.
      Parameters:
      connection -
      message -
      dstAddress -
      writtenSize -
    • createAddrHolder

      protected Holder<L> createAddrHolder(L dstAddress)
      Create an address holder.
      Parameters:
      dstAddress -
      Returns:
    • reset

      protected void reset()
    • recycle

      public void recycle()
      Specified by:
      recycle in interface Cacheable
    • copy

      public Object copy()
      Specified by:
      copy in interface Copyable