All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class JavaGroups.JavaStack.Protocols.FRAG

java.lang.Object
   |
   +----JavaGroups.JavaStack.Protocol
           |
           +----JavaGroups.JavaStack.Protocols.FRAG

public class FRAG
extends Protocol
Fragmentation layer. Fragments messages larger than FRAG_SIZE into smaller packets. Reassembles fragmented packets into bigger ones. The fragmentation number is prepended to the messages as a header (and removed at the receiving side).

Each fragment is identified by (a) the sender (part of the message to which the header is appended), (b) the fragmentation ID (which is unique per FRAG layer (monotonically increasing) and (c) the fragement ID which ranges from 0 to number_of_fragments-1.

Requirement: lossless delivery (e.g. NAK, ACK). No requirement on ordering. Works for both unicast and multicast messages. Typical stack:

FIFO
FRAG
NAK
UDP


Constructor Index

 o FRAG()

Method Index

 o Down(Event)
Fragment a packet if larger than frag_size (add a header).
 o GetName()
 o Reset()
Just remove if you don't need to reset any state
 o SetProperties(Properties)
Setup the Protocol instance acording to the configuration string
 o Up(Event)
If event is a message, if it is fragmented, re-assemble fragments into big message and pass up the stack.

Constructors

 o FRAG
 public FRAG()

Methods

 o GetName
 public String GetName()
Overrides:
GetName in class Protocol
 o SetProperties
 public boolean SetProperties(Properties props)
Setup the Protocol instance acording to the configuration string

Overrides:
SetProperties in class Protocol
 o Reset
 public void Reset()
Just remove if you don't need to reset any state

Overrides:
Reset in class Protocol
 o Down
 public void Down(Event evt)
Fragment a packet if larger than frag_size (add a header). Otherwise just pass down. Only add a header if framentation is needed !

Overrides:
Down in class Protocol
 o Up
 public void Up(Event evt)
If event is a message, if it is fragmented, re-assemble fragments into big message and pass up the stack.

Overrides:
Up in class Protocol

All Packages  Class Hierarchy  This Package  Previous  Next  Index