Rice Pastry API

rice.scribe.messaging
Class MessageHeartBeat

java.lang.Object
  |
  +--rice.pastry.messaging.Message
        |
        +--rice.scribe.messaging.ScribeMessage
              |
              +--rice.scribe.messaging.MessageHeartBeat
All Implemented Interfaces:
java.io.Serializable

public class MessageHeartBeat
extends ScribeMessage
implements java.io.Serializable

HeartBeatMessage is used whenever a Scribe nodes wishes let its children know that it is still alive, so that the children need not do any repairing of the multicast tree. We send a single HeartBeat Message to a node when it is our child for more than one topic, thereby avoiding sending multiple HeartBeat messages to same node.

Version:
$Id: MessageHeartBeat.java,v 1.12 2002/11/21 05:13:10 atuls Exp $
Author:
Romer Gil, Atul Singh, Animesh Nandi
See Also:
Serialized Form

Field Summary
 
Fields inherited from class rice.scribe.messaging.ScribeMessage
m_source, m_topicId
 
Constructor Summary
MessageHeartBeat(rice.pastry.messaging.Address addr, rice.pastry.NodeHandle source, rice.pastry.security.Credentials c)
          Constructor
 
Method Summary
 void handleDeliverMessage(rice.scribe.Scribe scribe, rice.scribe.Topic tp)
          This method is called whenever the scribe node receives a message for itself and wants to process it.
 boolean handleForwardMessage(rice.scribe.Scribe scribe, rice.scribe.Topic topic)
          This method is called whenever the scribe node forwards a message in the scribe network.
 java.lang.String toString()
           
 
Methods inherited from class rice.scribe.messaging.ScribeMessage
getData, getSource, getTopicId, setData
 
Methods inherited from class rice.pastry.messaging.Message
getCredentials, getDate, getDestination, getSenderId, getStream, hasPriority, setPriority, setSenderId, stamp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MessageHeartBeat

public MessageHeartBeat(rice.pastry.messaging.Address addr,
                        rice.pastry.NodeHandle source,
                        rice.pastry.security.Credentials c)
Constructor

Parameters:
addr - the address of the scribe receiver.
source - the node generating the message.
c - the credentials associated with the mesasge.
Method Detail

handleDeliverMessage

public void handleDeliverMessage(rice.scribe.Scribe scribe,
                                 rice.scribe.Topic tp)
This method is called whenever the scribe node receives a message for itself and wants to process it. The processing is delegated by scribe to the message. If a node has a common parent for some number of topics, then it is going to receive a common HeartBeat message for all those topics. So, it will find out all topics for which this message's source is its parent and consider this message as a HeartBeat message for all those topics.

Specified by:
handleDeliverMessage in class ScribeMessage
Parameters:
scribe - the scribe application.
tp - the dummy topic ( = null), used because MessageHeartBeat extends ScribeMessage.

handleForwardMessage

public boolean handleForwardMessage(rice.scribe.Scribe scribe,
                                    rice.scribe.Topic topic)
This method is called whenever the scribe node forwards a message in the scribe network. The processing is delegated by scribe to the message.

Specified by:
handleForwardMessage in class ScribeMessage
Parameters:
scribe - the scribe application.
topic - the Topic is null here
Returns:
true if the message should be routed further, false otherwise.

toString

public java.lang.String toString()
Specified by:
toString in class ScribeMessage

Rice Pastry API

Copyright © 2001 - Rice Pastry.


Imprint-Dataprotection