Class FragmentationInterceptor.FragCollection
- java.lang.Object
-
- org.apache.catalina.tribes.group.interceptors.FragmentationInterceptor.FragCollection
-
- Enclosing class:
- FragmentationInterceptor
public static class FragmentationInterceptor.FragCollection extends java.lang.ObjectCollection that holds the fragments of a message for reassembly.
-
-
Constructor Summary
Constructors Constructor Description FragCollection(ChannelMessage msg)Creates a new fragment collection for the given message.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMessage(ChannelMessage msg)Adds a fragment message to this collection.ChannelMessageassemble()Assembles all fragments into a single complete message.booleancomplete()Checks if all fragments have been received.booleanexpired(long expire)Checks if this fragment collection has expired.
-
-
-
Constructor Detail
-
FragCollection
public FragCollection(ChannelMessage msg)
Creates a new fragment collection for the given message.- Parameters:
msg- The channel message containing fragment metadata
-
-
Method Detail
-
addMessage
public void addMessage(ChannelMessage msg)
Adds a fragment message to this collection.- Parameters:
msg- The fragment message to add
-
complete
public boolean complete()
Checks if all fragments have been received.- Returns:
trueif all fragments are present
-
assemble
public ChannelMessage assemble()
Assembles all fragments into a single complete message.- Returns:
- The assembled channel message
- Throws:
java.lang.IllegalStateException- if not all fragments have been received
-
expired
public boolean expired(long expire)
Checks if this fragment collection has expired.- Parameters:
expire- The expiration time in milliseconds- Returns:
trueif the collection has expired
-
-