|
||||||||
| 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
rmi.ChatParticipant
public abstract class ChatParticipant
Class for participants in simple chat application. This class contains code common to server and clients. All parties maintain a list of clients.
| Field Summary | |
|---|---|
protected java.util.List<ChatClientInterface> |
clients
|
static java.lang.String |
errorPrefix
Prefix for error messages. |
static java.lang.String |
serverPrefix
Prefix for messages from server. |
| Fields inherited from class java.rmi.server.RemoteObject |
|---|
ref |
| Constructor Summary | |
|---|---|
ChatParticipant()
Constructs object. |
|
| Method Summary | |
|---|---|
void |
addClient(ChatClientInterface c)
Adds client. |
void |
broadcast(java.lang.String message)
Sends message to all clients. |
abstract java.lang.String |
getMessagePrefix()
Gets prefix for messages broadcast by this object. |
void |
removeClient(ChatClientInterface c)
Removes client. |
| 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 |
| Methods inherited from interface rmi.ChatParticipantInterface |
|---|
display |
| Field Detail |
|---|
protected java.util.List<ChatClientInterface> clients
public static final java.lang.String serverPrefix
public static final java.lang.String errorPrefix
| Constructor Detail |
|---|
public ChatParticipant()
throws java.rmi.RemoteException
java.rmi.RemoteException| Method Detail |
|---|
public void addClient(ChatClientInterface c)
throws java.rmi.RemoteException
addClient in interface ChatParticipantInterfacec - client to add
java.rmi.RemoteException
public void removeClient(ChatClientInterface c)
throws java.rmi.RemoteException
removeClient in interface ChatParticipantInterfacec - client to remove
java.rmi.RemoteException
public void broadcast(java.lang.String message)
throws java.rmi.RemoteException
broadcast in interface ChatParticipantInterfacemessage - message to send to all
java.rmi.RemoteExceptionpublic abstract java.lang.String getMessagePrefix()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||