|
||||||||
| 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.ChatClientImpl
public class ChatClientImpl
Class for client for simple chat program. An object of this class provides the functionality needed to communicate with the server and other clients; the user interface is provided by an object of a class implementing the ChatClientUI interface.
| 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 | |
|---|---|
ChatClientImpl(java.lang.String name,
java.lang.String serverHost,
ChatClientUI ui)
Constructs client object, querying server for a list of other clients and displaying this information. |
|
| Method Summary | |
|---|---|
void |
addClient(ChatClient c)
Adds client, displaying some info about the new client. |
void |
display(java.lang.String message)
Displays message, using whatever method is provided by the user interface for the client. |
java.lang.String |
getAddress()
Gets client's hostname/IPA. |
java.lang.String |
getMessagePrefix()
Gets prefix for messages broadcast by this object. |
java.lang.String |
getScreenName()
Gets client's screen name. |
void |
removeClient(ChatClient c)
Removes client, displaying some info about it. |
void |
shutdown()
Shuts down, notifying server that we're leaving. |
void |
startup()
Starts up. |
| Methods inherited from class edu.trinity.cs.bmassing.rmi.ChatPartyImpl |
|---|
broadcast |
| 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 edu.trinity.cs.bmassing.rmi.ChatParty |
|---|
broadcast |
| Constructor Detail |
|---|
public ChatClientImpl(java.lang.String name,
java.lang.String serverHost,
ChatClientUI ui)
throws java.rmi.RemoteException,
java.rmi.NotBoundException,
java.net.MalformedURLException
name - screen nameserverHost - host where server is runningui - user interface for client (provides something on
which to display messages, etc.)
java.rmi.RemoteException
java.rmi.NotBoundException
java.net.MalformedURLException| 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 java.lang.String getScreenName()
throws java.rmi.RemoteException
getScreenName in interface ChatClientjava.rmi.RemoteException
public java.lang.String getAddress()
throws java.rmi.RemoteException
getAddress in interface ChatClientjava.rmi.RemoteException
public void display(java.lang.String message)
throws java.rmi.RemoteException
display in interface ChatPartymessage - message to display
java.rmi.RemoteException
public void startup()
throws java.rmi.RemoteException
startup in interface ChatClientjava.rmi.RemoteException
public void shutdown()
throws java.rmi.RemoteException
shutdown in interface ChatClientjava.rmi.RemoteExceptionpublic java.lang.String getMessagePrefix()
getMessagePrefix in class ChatPartyImpl
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||