org.jgroups.demos
Class Topology
Frame
org.jgroups.demos.Topology
- WindowListener, MembershipListener
public class Topology
extends Frame
Demonstrates the membership service. Each member is represented by a rectangle that contains the
addresses of all the members. The coordinator (= oldest member in the group) is painted in blue.
New members can be started; all existing members will update their graphical appearance to reflect
the new membership. When the coordinator itself is killed, another one will take over (the next in rank).
A nice demo is to start a number of Topology instances at the same time. All of them will be blue (all are
coordinators since they don't find each other). Then the MERGE2 protocol sets in and only one will retain
its coordinator role.
todo: needs to be ported to Swing
Topology
public Topology()
addNode
public void addNode(Object member)
coordinatorChosen
public void coordinatorChosen()
drawNode
public void drawNode(Graphics g,
int x,
int y,
String label,
int style)
drawTopology
public void drawTopology(Graphics g)
main
public static void main(String[] args)
paint
public void paint(Graphics g)
removeNode
public void removeNode(Object member)
setState
public void setState(Vector mbrs)
start
public void start()
throws Exception
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) 2001,2002 www.jgroups.com . All Rights Reserved.