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()
Block sending and receiving of messages until viewAccepted() is called
static void
main(args[] )
void
start()
void
suspect(Address suspected_mbr)
Called when a member is suspected
void
viewAccepted(View new_view)
Called by JGroups to notify the target object of a change of membership.
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()
Block sending and receiving of messages until viewAccepted() is called
Specified by:
block in interface MembershipListener

main

public static void main(args[] )

start

public void start()

suspect

public void suspect(Address suspected_mbr)
Called when a member is suspected
Specified by:
suspect in interface MembershipListener

viewAccepted

public void viewAccepted(View new_view)
Called by JGroups to notify the target object of a change of membership. No long running actions should be done in this callback in the case of Ensemble, as this would block Ensemble. If some long running action needs to be performed, it should be done in a separate thread (cf. ../Tests/QuoteServer.java).
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) 2001,2002 www.jgroups.com . All Rights Reserved.