public class QuoteServer extends ReceiverAdapter
Any updates are multicast across the cluster
| 构造器和说明 |
|---|
QuoteServer() |
| 限定符和类型 | 方法和说明 |
|---|---|
java.util.Hashtable |
getAllStocks() |
float |
getQuote(java.lang.String stock_name) |
void |
getState(java.io.OutputStream ostream)
Allows an application to write a state through a provided OutputStream.
|
static void |
main(java.lang.String[] args) |
void |
printAllStocks() |
void |
setQuote(java.lang.String stock_name,
java.lang.Float value) |
void |
setState(java.io.InputStream istream)
Allows an application to read a state through a provided InputStream.
|
void |
start() |
void |
viewAccepted(View new_view)
Called when a change in membership has occurred.
|
block, receive, suspect, unblockpublic void viewAccepted(View new_view)
ReceiverAdapterChannel.connect(String) returns.viewAccepted 在接口中 MembershipListenerviewAccepted 在类中 ReceiverAdapterpublic void start()
public float getQuote(java.lang.String stock_name)
throws java.lang.Exception
java.lang.Exceptionpublic void setQuote(java.lang.String stock_name,
java.lang.Float value)
public java.util.Hashtable getAllStocks()
public void printAllStocks()
public void getState(java.io.OutputStream ostream)
throws java.lang.Exception
ReceiverAdaptergetState 在接口中 MessageListenergetState 在类中 ReceiverAdapterostream - the OutputStreamjava.lang.Exception - if the streaming fails, any exceptions should be thrown so that the state requester
can re-throw them and let the caller know what happenedOutputStream.close()public void setState(java.io.InputStream istream)
throws java.lang.Exception
ReceiverAdaptersetState 在接口中 MessageListenersetState 在类中 ReceiverAdapteristream - the InputStreamjava.lang.Exception - if the streaming fails, any exceptions should be thrown so that the state requester
can catch them and thus know what happenedInputStream.close()public static void main(java.lang.String[] args)