Class 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 Detail

      • Gossip

        public Gossip​(java.lang.String props,
                      long traffic)
               throws java.lang.Exception
        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