public class QuoteServer extends Object implements MembershipListener, MessageListener
Any updates are multicast across the cluster
Constructor and Description |
---|
QuoteServer() |
Modifier and Type | Method and Description |
---|---|
void |
block()
Called (usually by the FLUSH protocol), as an indication that the member should stop sending messages.
|
Hashtable |
getAllStocks() |
float |
getQuote(String stock_name) |
byte[] |
getState()
Answers the group state; e.g., when joining.
|
static void |
main(String[] args) |
void |
printAllStocks() |
void |
receive(Message msg)
Called when a message is received.
|
void |
setQuote(String stock_name,
Float value) |
void |
setState(byte[] state)
Sets the group state; e.g., when joining.
|
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.
|
public void viewAccepted(View new_view)
MembershipListener
Channel.connect(String)
returns.viewAccepted
in interface MembershipListener
public void suspect(Address suspected_mbr)
MembershipListener
suspect
in interface MembershipListener
public void block()
MembershipListener
ExtendedMembershipListener.unblock()
.
Note that block() is the equivalent of reception of a BlockEvent in the pull mode.block
in interface MembershipListener
public void start()
public Hashtable getAllStocks()
public void printAllStocks()
public void receive(Message msg)
MessageListener
receive
in interface MessageListener
public byte[] getState()
MessageListener
getState
in interface MessageListener
public void setState(byte[] state)
MessageListener
setState
in interface MessageListener
public static void main(String[] args)
Copyright © 2013 JBoss, a division of Red Hat. All Rights Reserved.