Package org.jgroups.demos
Class Gossip
java.lang.Object
org.jgroups.demos.Gossip
- All Implemented Interfaces:
ActionListener
,WindowListener
,Runnable
,EventListener
,ChannelListener
public class Gossip
extends 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
channelClosed
(Channel channel) void
channelConnected
(Channel channel) void
channelDisconnected
(Channel channel) void
channelReconnected
(Address new_addr) void
void
void
colorPanel
(int r, int g, int b) void
go()
static void
void
void
run()
void
void
void
void
void
void
void
void
-
Constructor Details
-
Gossip
- Throws:
Exception
-
-
Method Details
-
main
-
go
public void go() -
run
public void run() -
mouseMoved
-
clearPanel
public void clearPanel() -
colorPanel
public void colorPanel(int r, int g, int b) -
sendClearPanelMsg
public void sendClearPanelMsg() -
windowActivated
- Specified by:
windowActivated
in interfaceWindowListener
-
windowClosed
- Specified by:
windowClosed
in interfaceWindowListener
-
windowClosing
- Specified by:
windowClosing
in interfaceWindowListener
-
windowDeactivated
- Specified by:
windowDeactivated
in interfaceWindowListener
-
windowDeiconified
- Specified by:
windowDeiconified
in interfaceWindowListener
-
windowIconified
- Specified by:
windowIconified
in interfaceWindowListener
-
windowOpened
- Specified by:
windowOpened
in interfaceWindowListener
-
actionPerformed
- Specified by:
actionPerformed
in interfaceActionListener
-
channelConnected
- Specified by:
channelConnected
in interfaceChannelListener
-
channelDisconnected
- Specified by:
channelDisconnected
in interfaceChannelListener
-
channelClosed
- Specified by:
channelClosed
in interfaceChannelListener
-
channelShunned
public void channelShunned()- Specified by:
channelShunned
in interfaceChannelListener
-
channelReconnected
- Specified by:
channelReconnected
in interfaceChannelListener
-