SiteConfig.java for your current
configuration.
NUMBER_OF_SITES to 2. THIS IS ONLY FOR TESTING. YOUR
FINAL CODE SHOULD RUN ON FIVE SITES.
RMI_PORT field to this number. Keep this number in mind.
RMI_SERVER field to your current server
name.
javac SiteConfig.java
javac SiteImpl.java
rmic SiteImpl
javac Treasure.java
rmiregistry <port> &
where <port> is the number you choose in step 1.2 above.
java SiteImpl Site0 java SiteImpl Site1 java Treasure Site0Now the Treasure object is launched from Site0 and it bounces between Sites 0 and 1 for a while before stopping.
SiteConfig contains the configuration parameters like
RMI server name, port numbers, etc.
SiteImpl is the Site Manager. It takes a command line
argument which determines the site name.
Treasure is the Treasure object. It takes a command
line argument which is the name of its first destination. After that, it randomly
hops between sites.
You should also write the Player, take care of reflection, etc.
You can also study some example code from Java Examples in a Nutshell. Examples 15-1 to 15-7 pertain to RMI and Examples 12-1 and 12-2 pertain to Reflection.