Class FRAG3.FragEntry

java.lang.Object
org.jgroups.protocols.FRAG3.FragEntry
Enclosing class:
FRAG3

protected class FRAG3.FragEntry extends Object
Entry for a full message, received fragments are copied into buffer and set in the bitset of expected frags. When complete, the buffer is set in the resulting message and the message returned.
  • Field Details

    • lock

      protected final Lock lock
    • msg

      protected Message msg
    • buffer

      protected byte[] buffer
    • num_frags

      protected final int num_frags
    • received

      protected final FixedSizeBitSet received
    • needs_deserialization

      protected final boolean needs_deserialization
  • Constructor Details

    • FragEntry

      protected FragEntry(int num_frags, boolean needs_deserialization)
      Creates a new entry
      Parameters:
      num_frags - the number of fragments expected for this message
  • Method Details

    • set

      public Message set(Message frag_msg, Frag3Header hdr)
      Adds a fragment to the full message
    • isComplete

      protected boolean isComplete()
      Returns true if this fragmentation is complete, ie all fragments have been received for this buffer
    • assembleMessage

      protected Message assembleMessage() throws Exception
      Assembles all the fragments into one buffer. Takes all Messages, and combines their buffers into one buffer.
      Returns:
      the complete message in one buffer
      Throws:
      Exception
    • toString

      public String toString()
      Overrides:
      toString in class Object