org.javagroups.demos
Class Gossip

java.lang.Object
  |
  +--org.javagroups.demos.Gossip
All Implemented Interfaces:
java.awt.event.ActionListener, ChannelListener, java.util.EventListener, java.lang.Runnable, java.awt.event.WindowListener

public class Gossip
extends java.lang.Object
implements java.lang.Runnable, java.awt.event.WindowListener, java.awt.event.ActionListener, ChannelListener

Demos that tries to graphically illustrating the gossip (or pbcast) protocol: every sender periodically sends a DRAW command to a random subset of the group members. Each member checks whether it already received the message and applies it if not yet received. Otherwise it discards it. If not yet received, the message will be forwarded to 10% of the group members. This demo is probably only interesting when we have a larger number of members: a gossip will gradually reach all members, coloring their whiteboards.


Constructor Summary
Gossip(java.lang.String props, long traffic)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 void channelClosed(Channel channel)
           
 void channelConnected(Channel channel)
           
 void channelDisconnected(Channel channel)
           
 void channelReconnected(Address new_addr)
           
 void channelShunned()
           
 void clearPanel()
           
 void colorPanel(int r, int g, int b)
           
 void go()
           
static void main(java.lang.String[] args)
           
 void mouseMoved(java.awt.event.MouseEvent e)
           
 void run()
           
 void sendClearPanelMsg()
           
 void windowActivated(java.awt.event.WindowEvent e)
           
 void windowClosed(java.awt.event.WindowEvent e)
           
 void windowClosing(java.awt.event.WindowEvent e)
           
 void windowDeactivated(java.awt.event.WindowEvent e)
           
 void windowDeiconified(java.awt.event.WindowEvent e)
           
 void windowIconified(java.awt.event.WindowEvent e)
           
 void windowOpened(java.awt.event.WindowEvent e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Gossip

public Gossip(java.lang.String props,
              long traffic)
       throws java.lang.Exception
Method Detail

main

public static void main(java.lang.String[] args)

go

public void go()

run

public void run()
Specified by:
run in interface java.lang.Runnable

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)

clearPanel

public void clearPanel()

colorPanel

public void colorPanel(int r,
                       int g,
                       int b)

sendClearPanelMsg

public void sendClearPanelMsg()

windowActivated

public void windowActivated(java.awt.event.WindowEvent e)
Specified by:
windowActivated in interface java.awt.event.WindowListener

windowClosed

public void windowClosed(java.awt.event.WindowEvent e)
Specified by:
windowClosed in interface java.awt.event.WindowListener

windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
Specified by:
windowClosing in interface java.awt.event.WindowListener

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent e)
Specified by:
windowDeactivated in interface java.awt.event.WindowListener

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent e)
Specified by:
windowDeiconified in interface java.awt.event.WindowListener

windowIconified

public void windowIconified(java.awt.event.WindowEvent e)
Specified by:
windowIconified in interface java.awt.event.WindowListener

windowOpened

public void windowOpened(java.awt.event.WindowEvent e)
Specified by:
windowOpened in interface java.awt.event.WindowListener

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

channelConnected

public void channelConnected(Channel channel)
Specified by:
channelConnected in interface ChannelListener

channelDisconnected

public void channelDisconnected(Channel channel)
Specified by:
channelDisconnected in interface ChannelListener

channelClosed

public void channelClosed(Channel channel)
Specified by:
channelClosed in interface ChannelListener

channelShunned

public void channelShunned()
Specified by:
channelShunned in interface ChannelListener

channelReconnected

public void channelReconnected(Address new_addr)
Specified by:
channelReconnected in interface ChannelListener


Copyright © 2001,2002 www.javagroups.com . All Rights Reserved.