jgroup.relacs.mss
Class MsgJG

java.lang.Object
  extended by jgroup.relacs.mss.MsgJG
All Implemented Interfaces:
Msg, MssConstants, MssTag

public final class MsgJG
extends java.lang.Object
implements Msg, MssConstants, MssTag

The MsgJG class is the main mss level message, used for passing Jgroup related multicast messages to group members.

Since:
Jgroup 1.2
Author:
Hein Meling

Field Summary
 
Fields inherited from interface jgroup.relacs.mss.MssConstants
ALL, EHANDLER_PRIORITY, HEADER_SIZE, MINIMUM_ALIVE_VALUE, MSS_HEADER_SIZE, MSSUSER_PRIORITY, NACKSUPPRESSION, NI_PRIORITY, OVERHEAD_SIZE, ROUTING_ENABLED, TRAILER_SIZE, UNDEF, UNREACHABLE
 
Fields inherited from interface jgroup.relacs.mss.MssTag
ASYN, CONGESTION, EXTERNFC, FWDROUTING, IAMALIVE, JG, LOCALFC, NACK, NOTLASTFRAGMENT, PING_OBJECT, QSYN, REMOTENACK, ROUTING, SENT, SENTNACK, SYN, TAGTYPE, TOPOLOGY
 
Method Summary
 jgroup.relacs.mss.Cluster getCluster()
          Returns the destination cluster of this message.
 byte getJGTag()
          Returns the upper level Jgroup tag associated with this message.
 int getMid()
          Returns the message identifier for this message.
 jgroup.relacs.mss.MsgFlowSndrSide getMsgFlow()
          Returns the message flow controller for the sender side.
 OutMessage getOutMessage()
          Returns the OutMessage associated with this message.
 EndPoint[] getReceivers()
          Returns the receiver set for this message.
 MssHost getSender()
          Returns the sender of this message.
 byte getTag()
          Returns the tag associated with this message.
 boolean hasToBeRouted()
          Returns true if this message has to be routed to a different cluster.
 FragmentIterator iterator(jgroup.relacs.mss.MsgCntrl msgCntrl)
          Returns a FragmentIterator for this MsgJG object.
 void setCluster(jgroup.relacs.mss.Cluster cluster)
           
 void setReceivers(java.util.List receivers)
          Marshal receivers into the stream of this message.
 java.lang.String toString()
          Returns a string representation of this object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

iterator

public FragmentIterator iterator(jgroup.relacs.mss.MsgCntrl msgCntrl)
Returns a FragmentIterator for this MsgJG object. This iterator allows to send the entire message as multiple fragments of specified size (payload). At the same time, it marks each fragment with a tag and message identifier provided through the next() method of the iterator. Note that MsgJG messages cannot reuse the same iterator for sending to multiple clusters. This is because, at each iteration reuse, the fragment identifier is changed, causing problems when doing lookup in the sent queue to resend a message.

Specified by:
iterator in interface Msg

getTag

public byte getTag()
Returns the tag associated with this message.

Specified by:
getTag in interface Msg

getMid

public int getMid()
Returns the message identifier for this message.

Specified by:
getMid in interface Msg

getSender

public MssHost getSender()
Returns the sender of this message.

Specified by:
getSender in interface Msg

hasToBeRouted

public boolean hasToBeRouted()
Returns true if this message has to be routed to a different cluster.

Specified by:
hasToBeRouted in interface Msg

getMsgFlow

public jgroup.relacs.mss.MsgFlowSndrSide getMsgFlow()
Returns the message flow controller for the sender side.

Specified by:
getMsgFlow in interface Msg

getOutMessage

public OutMessage getOutMessage()
Returns the OutMessage associated with this message.

Specified by:
getOutMessage in interface Msg

setReceivers

public void setReceivers(java.util.List receivers)
Marshal receivers into the stream of this message. If there are no receivers specified (the receivers list is empty), this means that all members should receive this message.

This method is invoked for each cluster, to marshal the receivers that belong to that cluster into the stream. That means, not all actual receivers may be marshalled into the stream.

Parameters:
receivers - List of receivers for this message; if the list is empty, all should receive the message.

setCluster

public void setCluster(jgroup.relacs.mss.Cluster cluster)

getCluster

public jgroup.relacs.mss.Cluster getCluster()
Returns the destination cluster of this message.


getReceivers

public EndPoint[] getReceivers()
Returns the receiver set for this message. On the sending side, this includes all receivers, while on the receiver side this may only include those that were marshalled into the message for a particular cluster.


getJGTag

public byte getJGTag()
Returns the upper level Jgroup tag associated with this message.

See Also:
Tag

toString

public java.lang.String toString()
Returns a string representation of this object

Overrides:
toString in class java.lang.Object


Copyright © 1998-2006 The Jgroup/ARM development team. All Rights Reserved.