All Packages Class Hierarchy This Package Previous Next Index
Class iBus.layers.FRAG
java.lang.Object
|
+----iBus.ProtocolObject
|
+----iBus.layers.FRAG
- public class FRAG
- extends ProtocolObject
FRAG fragments and reassembles messages that are larger than a certain
size. To that purpose FRAG assigns fragment IDs (0 - n-1) to
the fragments of an outgoing message. The fragment size can be specified
as part of a QOS string. The default size matches a UDP datagram size.
For assembling fragments to messages, FRAG maintains one incoming
queue per senderURL/channelURL combination.
PARAMETERS:
-
size: int: > 0. The fragment size.
Default: 8192.
POSITION IN STACK:
-
above NAK. FRAG assumes that fragments are received in the sequence
they were sent and that no fragments are lost
EVENTS PRODUCED:
-
a message event after all of its fragments are received (up)
-
a message event per fragment (down)
EVENTS HANDLED:
EVENTS CONSUMED:
-
MessageEvents from above that are to be fragmented.
-
MessageEvents from below that contain fragments
-
fragSize_
-
-
FRAG()
- Creates a protocol object and assigns a name to it.
-
dnBytesAdded(MessageEvent)
- Called by protocol objects such as FRAG to find out how many bytes
will be constantly added to the message by the protocol objects below.
-
dnInit()
- Initialize the protocol object after the protocol stack has been
created.
-
dnPush(iBusURL, MessageEvent)
- Called by the object above to send ``data'' to ``dest'' using
multicast or unicast communication, depending on the URL:
-
getFragSize()
- Get the fragment size property.
-
upHandleEvent(Event)
- Called by the protocol object below to pass an event up to me.
fragSize_
protected int fragSize_
FRAG
public FRAG()
- Creates a protocol object and assigns a name to it.
dnInit
public synchronized void dnInit()
- Initialize the protocol object after the protocol stack has been
created. Also checks that the right parameters were given to the
protocol object.
- Overrides:
- dnInit in class ProtocolObject
dnPush
public void dnPush(iBusURL dest,
MessageEvent msg) throws CommException, NotRegistered
- Called by the object above to send ``data'' to ``dest'' using
multicast or unicast communication, depending on the URL:
- Parameters:
- dest - the destination of the posting
- msg - the message to be sent
- Throws: CommException
- on communication failure
- Throws: NotRegistered
- in case registerTalker
was not called for the channel
- Overrides:
- dnPush in class ProtocolObject
dnBytesAdded
public int dnBytesAdded(MessageEvent msg)
- Called by protocol objects such as FRAG to find out how many bytes
will be constantly added to the message by the protocol objects below.
(Only protocol objects that may be placed below FRAG need to implement
this function).
- Parameters:
- msg - the message to which the bytes will be added.
- Returns:
- the number of bytes that a protocol object constantly adds to
messages.
- Overrides:
- dnBytesAdded in class ProtocolObject
upHandleEvent
public void upHandleEvent(Event event)
- Called by the protocol object below to pass an event up to me.
An event can be the arrival of a posting, the detection of a failure,
a flow control request, etc.
- Parameters:
- event - determines the type of event
- Overrides:
- upHandleEvent in class ProtocolObject
getFragSize
public int getFragSize()
- Get the fragment size property.
- Returns:
- the fragment size property
All Packages Class Hierarchy This Package Previous Next Index