Package org.jgroups.demos
Class Gossip
- java.lang.Object
-
- org.jgroups.demos.Gossip
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
,ChannelListener
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
Constructors Constructor Description Gossip(java.lang.String props, long traffic)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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)
-
-
-
Method Detail
-
main
public static void main(java.lang.String[] args)
-
go
public void go()
-
run
public void run()
- Specified by:
run
in interfacejava.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 interfacejava.awt.event.WindowListener
-
windowClosed
public void windowClosed(java.awt.event.WindowEvent e)
- Specified by:
windowClosed
in interfacejava.awt.event.WindowListener
-
windowClosing
public void windowClosing(java.awt.event.WindowEvent e)
- Specified by:
windowClosing
in interfacejava.awt.event.WindowListener
-
windowDeactivated
public void windowDeactivated(java.awt.event.WindowEvent e)
- Specified by:
windowDeactivated
in interfacejava.awt.event.WindowListener
-
windowDeiconified
public void windowDeiconified(java.awt.event.WindowEvent e)
- Specified by:
windowDeiconified
in interfacejava.awt.event.WindowListener
-
windowIconified
public void windowIconified(java.awt.event.WindowEvent e)
- Specified by:
windowIconified
in interfacejava.awt.event.WindowListener
-
windowOpened
public void windowOpened(java.awt.event.WindowEvent e)
- Specified by:
windowOpened
in interfacejava.awt.event.WindowListener
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
- Specified by:
actionPerformed
in interfacejava.awt.event.ActionListener
-
channelConnected
public void channelConnected(Channel channel)
- Specified by:
channelConnected
in interfaceChannelListener
-
channelDisconnected
public void channelDisconnected(Channel channel)
- Specified by:
channelDisconnected
in interfaceChannelListener
-
channelClosed
public void channelClosed(Channel channel)
- Specified by:
channelClosed
in interfaceChannelListener
-
channelShunned
public void channelShunned()
- Specified by:
channelShunned
in interfaceChannelListener
-
channelReconnected
public void channelReconnected(Address new_addr)
- Specified by:
channelReconnected
in interfaceChannelListener
-
-