org.jgroups.protocols

Class 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.

Version: $Id: FRAG.java,v 1.28.2.1 2006/05/16 05:14:08 belaban Exp $

Author: Bela Ban Filip Hanik

Method Summary
voiddown(Event evt)
Fragment a packet if larger than frag_size (add a header).
intgetFragSize()
StringgetName()
longgetNumberOfReceivedFragments()
longgetNumberOfReceivedMessages()
longgetNumberOfSentFragments()
longgetNumberOfSentMessages()
voidresetStats()
voidsetFragSize(int s)
booleansetProperties(Properties props)
Setup the Protocol instance acording to the configuration string
voidup(Event evt)
If event is a message, if it is fragmented, re-assemble fragments into big message and pass up the stack.

Method Detail

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 !

getFragSize

public int getFragSize()

getName

public String getName()

getNumberOfReceivedFragments

public long getNumberOfReceivedFragments()

getNumberOfReceivedMessages

public long getNumberOfReceivedMessages()

getNumberOfSentFragments

public long getNumberOfSentFragments()

getNumberOfSentMessages

public long getNumberOfSentMessages()

resetStats

public void resetStats()

setFragSize

public void setFragSize(int s)

setProperties

public boolean setProperties(Properties props)
Setup the Protocol instance acording to the configuration string

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.
Copyright ? 1998-2005 Bela Ban. All Rights Reserved.