org.jgroups.demos

Class Gossip

Implemented Interfaces:
ActionListener, Runnable, WindowListener, ChannelListener

public class Gossip
extends java.lang.Object
implements Runnable, WindowListener, 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(String props, long traffic)

Method Summary

void
actionPerformed(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(String[] args)
void
mouseMoved(MouseEvent e)
void
run()
void
sendClearPanelMsg()
void
windowActivated(WindowEvent e)
void
windowClosed(WindowEvent e)
void
windowClosing(WindowEvent e)
void
windowDeactivated(WindowEvent e)
void
windowDeiconified(WindowEvent e)
void
windowIconified(WindowEvent e)
void
windowOpened(WindowEvent e)

Constructor Details

Gossip

public Gossip(String props,
              long traffic)
            throws Exception

Method Details

actionPerformed

public void actionPerformed(ActionEvent e)

channelClosed

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

channelConnected

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

channelDisconnected

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

channelReconnected

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

channelShunned

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

clearPanel

public void clearPanel()

colorPanel

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

go

public void go()

main

public static void main(String[] args)

mouseMoved

public void mouseMoved(MouseEvent e)

run

public void run()

sendClearPanelMsg

public void sendClearPanelMsg()

windowActivated

public void windowActivated(WindowEvent e)

windowClosed

public void windowClosed(WindowEvent e)

windowClosing

public void windowClosing(WindowEvent e)

windowDeactivated

public void windowDeactivated(WindowEvent e)

windowDeiconified

public void windowDeiconified(WindowEvent e)

windowIconified

public void windowIconified(WindowEvent e)

windowOpened

public void windowOpened(WindowEvent e)

Copyright B) 1998-2005 Bela Ban. All Rights Reserved.