Package org.jgroups.protocols
Class FRAG.FragmentationList
- java.lang.Object
-
- org.jgroups.protocols.FRAG.FragmentationList
-
- Enclosing class:
- FRAG
static class FRAG.FragmentationList extends java.lang.ObjectA 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 Summary
Fields Modifier and Type Field Description private java.util.HashMap<Address,FRAG.FragmentationTable>frag_tables
-
Constructor Summary
Constructors Constructor Description FragmentationList()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(Address sender, FRAG.FragmentationTable table)Adds a fragmentation table for this particular sender If this sender already has a fragmentation table, an IllegalArgumentException will be thrown.booleancontainsSender(Address sender)returns true if this sender already holds a fragmentation for this sender, false otherwiseFRAG.FragmentationTableget(Address sender)returns a fragmentation table for this sender returns null if the sender doesn't have a fragmentation tableAddress[]getSenders()returns a list of all the senders that have fragmentation tables opened.booleanremove(Address sender)removes the fragmentation table from the list.java.lang.StringtoString()
-
-
-
Field Detail
-
frag_tables
private final java.util.HashMap<Address,FRAG.FragmentationTable> frag_tables
-
-
Method Detail
-
add
public void add(Address sender, FRAG.FragmentationTable table) throws java.lang.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 nulltable- - the fragmentation table of this sender, cannot be null- Throws:
java.lang.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 java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-