New York
University
Computer
Science Department
Courant
Institute of Mathematical Sciences
Session 3:
RMI-IIOP MOO Framework Installation Instructions
Course Title: XML for Java Developers
Course Number: g22.3033-002
Instructor: Jean-Claude Franchitti Session:
3
1.
Extract RMI-IIOP-MOO.zip using winzip under c:\.
2.
After extraction, a directory named c:\RMI-IIOP-MOO is
created, which includes subdirectory ChatClientRMI and ChatServerRMI.
3.
Switch to c:\RMI-IIOP-MOO, and run the file “env.bat” to set
the CLASSPATH.
4.
Start the naming service “tnameserv” using default settings.
5.
Test
> cd c:\RMI-IIOP-MOO
> env.bat
> start tnameserv
>
c:\RMI-IIOP-MOO\ChatServerRMI\runs.bat
Open another DOS prompt
>
c:\RMI-IIOP-MOO\ChatClientRMI\runc.bat prof
Open another DOS prompt
>
c:\RMI-IIOP-MOO\ChatClientRMI\runc.bat student
1.
The chat room is implemented with RMI-IIOP, and the client
side is a Java application.
2.
RMI interfaces are similar to the IDL ones
ChatServerRMI.java describes the
interfaces to the server.
connect: called by client when the chat user
connects to the server.
disconnect: called by client when the chat user disconnects to the
server.
sendMessage: called by server when new user (dis)connect,
or by client
when some user send a message to others.
sendLocation: called by client when some user move his/her
position in
the graph.
ChatClientRMI.java describes the
interfaces to the client.
updateMessage: called by server when new messages arrives
updateLocation: called by
server when location changed for some user
3.
Communication
Messages are transferred via strings or
integers, while more complicated messages are encoded in strings instead of
sending objects.
4.
Client implementation
Each client has a user list to keep
track of all the online users. Each user has a record to record his/her info:
like name, location, etc.
The display of chat room is updated at
some time interval, timer is used to decide if a message should be displayed.
5.
Server implementation
There are five differrent servers (chat
rooms), and each has a user list to keep track of all its online users.
Furthermore, the client can enter any one of the five chat rooms, even after it
has left another room.