Class FRAG.FragmentationList

java.lang.Object
org.jgroups.protocols.FRAG.FragmentationList
Enclosing class:
FRAG

static class FRAG.FragmentationList extends Object
A fragmentation list keeps a list of fragmentation tables sorted by an Address ( the sender ). This way, if the sender disappears or leaves the group half way sending the content, we can simply remove this members fragmentation table and clean up the memory of the receiver. We do not have to do the same for the sender, since the sender doesn't keep a fragmentation table
  • Field Details

  • Constructor Details

    • FragmentationList

      FragmentationList()
  • Method Details

    • add

      public void add(Address sender, FRAG.FragmentationTable table) throws IllegalArgumentException
      Adds a fragmentation table for this particular sender If this sender already has a fragmentation table, an IllegalArgumentException will be thrown.
      Parameters:
      sender - - the address of the sender, cannot be null
      table - - the fragmentation table of this sender, cannot be null
      Throws:
      IllegalArgumentException - if an entry for this sender already exist
    • get

      public FRAG.FragmentationTable get(Address sender)
      returns a fragmentation table for this sender returns null if the sender doesn't have a fragmentation table
      Returns:
      the fragmentation table for this sender, or null if no table exist
    • containsSender

      public boolean containsSender(Address sender)
      returns true if this sender already holds a fragmentation for this sender, false otherwise
      Parameters:
      sender - - the sender, cannot be null
      Returns:
      true if this sender already has a fragmentation table
    • remove

      public boolean remove(Address sender)
      removes the fragmentation table from the list. after this operation, the fragementation list will no longer hold a reference to this sender's fragmentation table
      Parameters:
      sender - - the sender who's fragmentation table you wish to remove, cannot be null
      Returns:
      true if the table was removed, false if the sender doesn't have an entry
    • getSenders

      public Address[] getSenders()
      returns a list of all the senders that have fragmentation tables opened.
      Returns:
      an array of all the senders in the fragmentation list
    • toString

      public String toString()
      Overrides:
      toString in class Object