org.jgroups.demos.wb
Class Whiteboard
Applet
org.jgroups.demos.wb.Whiteboard
- ActionListener, ComponentListener, FocusListener, MembershipListener, MessageListener
public class Whiteboard
extends Applet
Shared whiteboard: members are represented by rectangles that contain their names and the OS/arch of
the machine they are working on. The boxes can be moved by anyone and by clicking on them, messages can
be sent to specific or all members. Whiteboard is both an application and an applet.
groupname
public static final String groupname
Whiteboard
public Whiteboard()
Whiteboard
public Whiteboard(String properties)
actionPerformed
public void actionPerformed(ActionEvent e)
addNode
public void addNode(String lbl,
Address addr,
int xloc,
int yloc)
block
public void block()
Called whenever the member needs to stop sending messages.
When the next view is received (viewAccepted()), the member can resume sending
messages. If a member does not comply, the message(s) sent between a block()
and a matching viewAccepted() callback will probably be delivered in the next view.
The block() callback is only needed by the Virtual Synchrony suite of protocols
(FLUSH protocol)3.2, otherwise it will never be invoked.
- block in interface MembershipListener
componentHidden
public void componentHidden(ComponentEvent e)
componentMoved
public void componentMoved(ComponentEvent e)
componentResized
public void componentResized(ComponentEvent e)
componentShown
public void componentShown(ComponentEvent e)
destroy
public void destroy()
displayMessage
public void displayMessage(String sender,
String msg)
focusGained
public void focusGained(FocusEvent e)
focusLost
public void focusLost(FocusEvent e)
getState
public byte[] getState()
Answers the group state; e.g., when joining.
- getState in interface MessageListener
main
public static void main(String[] args)
moveNode
public void moveNode(Node n)
removeNode
public void removeNode(Object addr)
repaint
public void repaint()
setState
public void setState(byte[] new_state)
Sets the group state; e.g., when joining.
- setState in interface MessageListener
suspect
public void suspect(Address obj)
Called whenever a member is suspected of having crashed,
but has not yet been excluded.
- suspect in interface MembershipListener
viewAccepted
public void viewAccepted(View v)
Called when a change in membership has occurred.
No long running actions should be done in this callback.
If some long running action needs to be performed, it should be done in a separate thread.
- viewAccepted in interface MembershipListener
Copyright B) 1998-2005 Bela Ban. All Rights Reserved.