org.jgroups.demos

Class Topology

public class Topology extends Frame implements WindowListener, MembershipListener

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.

Author: Bela Ban

UNKNOWN: Needs to be ported to Swing.

Constructor Summary
Topology()
Method Summary
voidaddNode(Object member)
voidblock()
voidcoordinatorChosen()
voiddrawNode(Graphics g, int x, int y, String label, int style)
voiddrawTopology(Graphics g)
static voidmain(String[] args)
voidpaint(Graphics g)
voidremoveNode(Object member)
voidsetState(Vector mbrs)
voidstart()
voidsuspect(Address suspected_mbr)
voidviewAccepted(View view)
voidwindowActivated(WindowEvent e)
voidwindowClosed(WindowEvent e)
voidwindowClosing(WindowEvent e)
voidwindowDeactivated(WindowEvent e)
voidwindowDeiconified(WindowEvent e)
voidwindowIconified(WindowEvent e)
voidwindowOpened(WindowEvent e)

Constructor Detail

Topology

public Topology()

Method Detail

addNode

public void addNode(Object member)

block

public void block()

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()

suspect

public void suspect(Address suspected_mbr)

viewAccepted

public void viewAccepted(View view)

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 ? 1998-2005 Bela Ban. All Rights Reserved.