SDSU CS 696 Emerging Technologies: Java Distributed Computing
Spring Semester, 1999
Reggie Problems Explained
Previous    Lecture Notes Index    Next    
© 1999, All Rights Reserved, SDSU & Roger Whitney
San Diego State University -- This page last updated 17-Apr-99

Contents of Doc 26, Reggie Problems Explained


References


Java Remote Method Invocation Specification

Local HTML Copy: http://www-rohan.sdsu.edu/java/jdk1.2/docs/guide/rmi/spec/rmiTOC.doc.html
Sun HTML Site: http://java.sun.com/products/jdk/1.2/docs/guide/rmi/spec/rmiTOC.doc.html

Jini API Documentation

Local HTML Copy: http://www-rohan.sdsu.edu/doc/jini/doc/api/index.html


Doc 26, Reggie Problems Explained Slide # 2
Starting Reggie Services

When you start a reggie service, the class com.sun.jini.reggie.RegistrarImpl is registered with rmid and rmid will create an instance of that class. This instance is the reggie server. Hence who ever starts the rmid will own the reggie server process. If your rmid uses a nonstandard process then you must inform reggie of the rmid port number. Set the java.rmi.activation.port property. See http://www-rohan.sdsu.edu/java/jdk1.2/docs/guide/rmi/spec/rmi-properties.doc2.html for details. The following uses the rmid listening on port 5435.

java -Djava.rmi.activation.port=5435 -jar  /opt/jini1_0/lib/reggie.jar
   http://fargo.sdsu.edu:8888/reggie-dl.jar
   /opt/jini1_0/example/lookup/policy
   /tmp/whitney/reggie_log
   whitney.rohan.sdsu.edu

A slightly better version of this command is:

java -Djava.rmi.activation.port=5435 -jar  /opt/jini1_0/lib/reggie.jar
   http://fargo.sdsu.edu:8888/reggie-dl.jar
   /opt/jini1_0/example/lookup/policy
   $HOME/reggie_log
   ´whoami´"."´hostname´"."´domainname´

this will use your home directory for the reggie log file and your login name, machine host name and domain name for the group.

Doc 26, Reggie Problems Explained Slide # 3
A Shell Script
Here is a modified version of the script that I use to start reggie

#/bin/csh
#Start jini services
switch ($#) 
   case 0:
   case 1:
      echo "Usage: reggie httpPort rmidPort"
      exit 2
endsw
set httpPort=$1;
set rmidPort=$2;
set jiniDir=/opt/jini1_0/lib
set jiniLog=~whitney/jini_data/jini_logs
set jiniData=~whitney/jini_data
rm -R $jiniLog/reggie 
java -Djava.rmi.activation.port=$rmidPort -jar 
  $jiniDir/reggie.jar http://eli.sdsu.edu:$httpPort/reggie-dl.jar 
  $jiniData/policy $jiniLog/reggie 
  ´whoami´"."´hostname´"."´domainname´ &
echo "reggie started"

Doc 26, Reggie Problems Explained Slide # 4
Some rmid Magic

Start rmid on port X
"Start reggie" (i.e. register it with rmid on port X & let rmid start reggie)
Run ps to get a list of processes

Note the pid of the reggie process

Use the kill command to kill the reggie process
Run ps again.
Note that reggie is running, but has a new pid!

rmid restarts reggie
Example
rohan 107-> ps
   PID TT       S  TIME COMMAND
 20590 pts/56   S  0:00 -tcsh
 24493 pts/56   S  0:02 /opt/java/bin/../rmid -port 23456
 25196 pts/56   S  0:12 /opt/../java -cp reggie
 22766 pts/112  S  0:00 -tcsh
rohan 108-> kill 25196
rohan 109-> ps
   PID TT       S  TIME COMMAND
 20590 pts/56   S  0:00 -tcsh
 24493 pts/56   S  0:02 /opt/java/bin/../rmid -port 23456
 27255 pts/56   S  0:01 /opt/../java -cp reggie
 22766 pts/112  S  0:00 -tcsh

Doc 26, Reggie Problems Explained Slide # 5
More rmid Magic

Stop rmid with the command:

   rmid -stop -port X

Use ps to verify that both rmid & reggie are not running

Start rmid in the directory that contains the rmid log, that is from the same location you first started rmid

Use ps to verify that both rmid & reggie are both running

Use the kill command to kill both rmid & reggie

Start rmid in the directory that contains the rmid log, that is from the same location you first started rmid

Use ps to verify that both rmid & reggie are both running

rmid is your friend

Doc 26, Reggie Problems Explained Slide # 6
Some Questions


reggie is activatable. It is meant to be started once and run from then on. When reggie/rmid/machine needs to be restarted, reggie is to be restarted by rmid.


You never start reggie. You register reggie with rmid and rmid starts reggie. If you contact am rmid started by another student, that student will own the reggie process. Make sure you start rmid and register your reggie with your rmid.


Why do you care which port reggie is using? Use the JoinManager to register a service with reggie with a particular group without knowing the port. See http://www-rohan.sdsu.edu/doc/jini/doc/api/com/sun/jini/lookup/JoinManager.html#JoinManager(java.lang.Object, net.jini.core.entry.Entry[], java.lang.String[], net.jini.core.discovery.LookupLocator[], com.sun.jini.lookup.ServiceIDListener, com.sun.jini.lease.LeaseRenewalManager) and doc 18, slide 4 ( http://www.eli.sdsu.edu/courses/spring99/cs696/notes/jiniHello/jiniHello.html). Use Discovery on the client side to find a reggie with a given group. See http://www.eli.sdsu.edu/courses/spring99/cs696/notes/jiniDiscovery/jiniDiscovery.html#Heading10


Make sure that the log directory and files do not already exists, that you own the reggie process, and that the parent directory for the reggie log exists and you have read/write privilege in that directory.

Copyright ©, All rights reserved.
1999 SDSU & Roger Whitney, 5500 Campanile Drive, San Diego, CA 92182-7700 USA.
OpenContent license defines the copyright on this document.

Previous    visitors since 17-Apr-99    Next