org.ow2.carol.cmi.ha
Class JGMessageManager

java.lang.Object
  extended by org.ow2.carol.cmi.ha.JGMessageManager
All Implemented Interfaces:
org.jgroups.blocks.RequestHandler, MessageManager

public class JGMessageManager
extends java.lang.Object
implements org.jgroups.blocks.RequestHandler, MessageManager

This class processes the HA messages received through JGroups.

Author:
Francisco Perez-Sorrosal (fpsorrosal@no-spam@fi.upm.es), Alberto Paz-Jimenez (apaz@no-spam@fi.upm.es)

Constructor Summary
JGMessageManager(java.lang.String jgroupsConf, java.lang.String jgroupsGroupname, ReplicationManager replicationManager)
          Constructor.
 
Method Summary
 void clear()
          Clear the GCS.
 double getAvgSizeofReplicatedMessages()
          Get the average size of the replicated messages sent.
 long getNumberofReplicatedMessages()
          Get the number of replicated messages sent.
 double getTotSizeofReplicatedMessages()
          Get the total size of the replicated messages sent.
 java.lang.Object handle(org.jgroups.Message message)
          Processes the replication messages received.
 java.lang.String jgroupsConfFileName()
          Get the JGroups configuration file name.
 void sendMessage(HaMessageData messageData)
          Sends a message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JGMessageManager

public JGMessageManager(java.lang.String jgroupsConf,
                        java.lang.String jgroupsGroupname,
                        ReplicationManager replicationManager)
Constructor.

Method Detail

sendMessage

public void sendMessage(HaMessageData messageData)
Description copied from interface: MessageManager
Sends a message.

Specified by:
sendMessage in interface MessageManager
Parameters:
messageData - the message

handle

public java.lang.Object handle(org.jgroups.Message message)
Processes the replication messages received. Depending on the message's type a concrete process will be performed

Specified by:
handle in interface org.jgroups.blocks.RequestHandler

clear

public void clear()
Description copied from interface: MessageManager
Clear the GCS.

Specified by:
clear in interface MessageManager

getNumberofReplicatedMessages

public long getNumberofReplicatedMessages()
Get the number of replicated messages sent.

Specified by:
getNumberofReplicatedMessages in interface MessageManager
Returns:
the number of replicated messages

getAvgSizeofReplicatedMessages

public double getAvgSizeofReplicatedMessages()
Get the average size of the replicated messages sent.

Specified by:
getAvgSizeofReplicatedMessages in interface MessageManager
Returns:
the average size of the replicated messages sent.

getTotSizeofReplicatedMessages

public double getTotSizeofReplicatedMessages()
Get the total size of the replicated messages sent.

Specified by:
getTotSizeofReplicatedMessages in interface MessageManager
Returns:
the total size of the replicated messages

jgroupsConfFileName

public java.lang.String jgroupsConfFileName()
Get the JGroups configuration file name.

Specified by:
jgroupsConfFileName in interface MessageManager
Returns:
the JGroups configuration file name


Copyright © 2007 OW2 Consortium. All Rights Reserved.