Homework 5 - RMI programming

Due 12:15, 4 December, 1997

Start with the following specification of an RMI interface:


package EDU.unca.cs.brock.csci363 ;

import java.rmi.*;

public interface Schedule extends Remote {
  public boolean ReserveTime(int start, int length, String event)
                     throws RemoteException, IllegalArgumentException ;
  public String  GetEvent(int time)
                     throws RemoteException, IllegalArgumentException ;
}

The intended semantics of this interface is an object for scheduling a room. The method

requests a reservation from the hour start for length hours. Hours are numbered from 0 to 23. If the hour arguments are inappropriate, that is, imply hours less than 0 or greater than 23, the method throws IllegalArgumentException. If the requested times are free, the reservation is entered with description event and true is returned. Otherwise, false is returned.

The method

returns a description for event at time hour or, if there is no event at that time, null. It also throws IllegalArgumentException for inappropriate input arguments.

Your assignment is (1) to write an RMI server in teams of two or three to implement the Schedule interface; and (2) to write an RMI client that calls both methods of the interface.

When you have finished the server, send email to brock@cs.unca.edu giving the location of the file containing the Java source code of the server and the name your server is using to register itself. Choose something unique for your name.

When you have finished your client, store it in csci/363/Home05.java of your Computer Science account. Write your Home05 class in such a way that it uses its first command argument is the URL of the RMI server to which it connects.

On the UNCA CSCI machines, you'll need to set your CLASSPATH environment variable to .:/usr/local/classes:/usr/lib/classes.zip with a command similar to

before compiling and running your programs.

By the way, there is a Schedule server presently running at


Back to the CSCI 363 homework page
Back to the CSCI 363 home page