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 TypeMethodDescriptionvoidvoidchannelClosed(Channel channel) voidchannelConnected(Channel channel) voidchannelDisconnected(Channel channel) voidchannelReconnected(Address new_addr) voidvoidvoidcolorPanel(int r, int g, int b) voidgo()static voidvoidvoidrun()voidvoidvoidvoidvoidvoidvoidvoid
-
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:
windowActivatedin interfaceWindowListener
-
windowClosed
- Specified by:
windowClosedin interfaceWindowListener
-
windowClosing
- Specified by:
windowClosingin interfaceWindowListener
-
windowDeactivated
- Specified by:
windowDeactivatedin interfaceWindowListener
-
windowDeiconified
- Specified by:
windowDeiconifiedin interfaceWindowListener
-
windowIconified
- Specified by:
windowIconifiedin interfaceWindowListener
-
windowOpened
- Specified by:
windowOpenedin interfaceWindowListener
-
actionPerformed
- Specified by:
actionPerformedin interfaceActionListener
-
channelConnected
- Specified by:
channelConnectedin interfaceChannelListener
-
channelDisconnected
- Specified by:
channelDisconnectedin interfaceChannelListener
-
channelClosed
- Specified by:
channelClosedin interfaceChannelListener
-
channelShunned
public void channelShunned()- Specified by:
channelShunnedin interfaceChannelListener
-
channelReconnected
- Specified by:
channelReconnectedin interfaceChannelListener
-