|
||||||||||
| 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
rmiServer.Server
public class Server
This class will publish its service on the rmiregistery. the service methods available are listed in ServerInterface.java an instance of the server will contain an array of 50 remote stubs of clients represented as ChatObjectInterface.
| Field Summary |
|---|
| Fields inherited from class java.rmi.server.RemoteObject |
|---|
ref |
| Constructor Summary | |
|---|---|
Server()
constructor. creats a server for chat application |
|
| Method Summary | |
|---|---|
void |
connect(java.lang.String name,
ChatObjectInterface c)
Implements the remote server method connect() that clients can use to connect to the server.It passes to the server the clients own remoter interface so that server can send messeges to this client.on successful registrations sends a welcome message to the user. |
void |
disconnect(ChatObjectInterface c)
a remote method that a client can use to tell the server that it is quiting the chat service. |
static void |
main(java.lang.String[] args)
The application launch point. |
void |
send(java.lang.String message)
This method is called by a remote client to send a string messege to all the other chat users.It specifically crawls through the servers client list and send the messege to all valid clients through the cleint remote interface |
void |
stopServer()
Called by the server to tell all clients that it is shutting down the service. |
| 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 Server()
throws java.rmi.RemoteException
java.rmi.RemoteException| Method Detail |
|---|
public void connect(java.lang.String name,
ChatObjectInterface c)
throws java.rmi.RemoteException
connect in interface ServerInterfacename - String could be used to enforce unique nickname for each userc - ChatObjectInterface
java.rmi.RemoteException
public void send(java.lang.String message)
throws java.rmi.RemoteException
send in interface ServerInterfacemessage - String
java.rmi.RemoteException
public void disconnect(ChatObjectInterface c)
throws java.rmi.RemoteException
disconnect in interface ServerInterfacec - ChatObjectInterface of the client who wants to exit ther service
java.rmi.RemoteExceptionpublic void stopServer()
public static void main(java.lang.String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||