|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjava.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
edu.trinity.cs.bmassing.rmi.ChatPartyImpl
edu.trinity.cs.bmassing.rmi.ChatServerImpl
public class ChatServerImpl
Class for server for simple chat program (with instructions for running the application). An object of this class functions as a server for the application.
| Field Summary |
|---|
| Fields inherited from class edu.trinity.cs.bmassing.rmi.ChatPartyImpl |
|---|
clients, errorPrefix, serverPrefix |
| Fields inherited from class java.rmi.server.RemoteObject |
|---|
ref |
| Constructor Summary | |
|---|---|
ChatServerImpl()
Constructs server object. |
|
| Method Summary | |
|---|---|
void |
addClient(ChatClient c)
Adds client, printing some info to standard output and telling all previous clients to add this one. |
void |
broadcast(java.lang.String message)
Sends message to all clients. |
void |
display(java.lang.String message)
Displays message. |
java.util.List<ChatClient> |
getClients()
Gets a list of clients. |
java.lang.String |
getMessagePrefix()
Gets prefix for messages broadcast by this object. |
static void |
main(java.lang.String[] args)
Main program -- creates a server object and registers it. |
void |
removeClient(ChatClient c)
Removes client, printing some info to standard output and telling all other clients to remove this one. |
| Methods inherited from class java.rmi.server.UnicastRemoteObject |
|---|
clone, exportObject, exportObject, exportObject, unexportObject |
| Methods inherited from class java.rmi.server.RemoteServer |
|---|
getClientHost, getLog, setLog |
| Methods inherited from class java.rmi.server.RemoteObject |
|---|
equals, getRef, hashCode, toString, toStub |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ChatServerImpl()
throws java.rmi.RemoteException
java.rmi.RemoteException| Method Detail |
|---|
public void addClient(ChatClient c)
throws java.rmi.RemoteException
addClient in interface ChatPartyaddClient in class ChatPartyImplc - client to add
java.rmi.RemoteException
public void removeClient(ChatClient c)
throws java.rmi.RemoteException
removeClient in interface ChatPartyremoveClient in class ChatPartyImplc - client to remove
java.rmi.RemoteException
public void broadcast(java.lang.String message)
throws java.rmi.RemoteException
broadcast in interface ChatPartybroadcast in class ChatPartyImplmessage - message to send to all
java.rmi.RemoteException
public void display(java.lang.String message)
throws java.rmi.RemoteException
display in interface ChatPartymessage - message to display
java.rmi.RemoteException
public java.util.List<ChatClient> getClients()
throws java.rmi.RemoteException
getClients in interface ChatServerjava.rmi.RemoteExceptionpublic java.lang.String getMessagePrefix()
getMessagePrefix in class ChatPartyImplpublic static void main(java.lang.String[] args)
args - command-line arguments -- not used
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||