org.jgroups.demos

Class QuoteClient

Implemented Interfaces:
ActionListener, WindowListener, MembershipListener

public class QuoteClient
extends Frame
implements WindowListener, ActionListener, MembershipListener

Used in conjunction with QuoteServer: a client is member of a group of quote servers which replicate stock quotes among themselves. The client broadcasts its request (set, get quotes) and (in the case of get waits for the first reply received (usually the one from the quote server closest to it). The client can get and set quotes as long as a minimum of 1 server (in the group) is running.
Author:
Bela Ban

Constructor Summary

QuoteClient()

Method Summary

void
actionPerformed(ActionEvent e)
void
block()
Called whenever the member needs to stop sending messages.
static void
main(args[] )
void
start()
void
suspect(Address suspected_mbr)
Called whenever a member is suspected of having crashed, but has not yet been excluded.
void
viewAccepted(View new_view)
Called when a change in membership has occurred.
void
windowActivated(WindowEvent e)
void
windowClosed(WindowEvent e)
void
windowClosing(WindowEvent e)
void
windowDeactivated(WindowEvent e)
void
windowDeiconified(WindowEvent e)
void
windowIconified(WindowEvent e)
void
windowOpened(WindowEvent e)

Constructor Details

QuoteClient

public QuoteClient()

Method Details

actionPerformed

public void actionPerformed(ActionEvent e)

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.
Specified by:
block in interface MembershipListener

main

public static void main(args[] )

start

public void start()

suspect

public void suspect(Address suspected_mbr)
Called whenever a member is suspected of having crashed, but has not yet been excluded.
Specified by:
suspect in interface MembershipListener

viewAccepted

public void viewAccepted(View new_view)
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.
Specified by:
viewAccepted in interface MembershipListener

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