Distributed Simjava - Example1
This example is the distributed version of example1 of the Simjava package.
A simple source and sink example. The source sends 100 messages to the sink
and waits for acknowledgements. This example is composed of 3 Java source
files:
Note: to run any of the distributed simjava examples you must be running JDK
1.1.1 and the values for JAVAHOME and CLASSPATH nust be
set as appropriate for your system.
To Run:
- Download and
install
the Distributed Simjava Software.
- Make sure your CLASSPATH variable contains the class files
for distributed Simjava. For example, on a UNIX system, you could
enter the command:
setenv CLASSPATH <target
directory>/distSimjava1.0/classes:<target
directory>/distSimjav1.0/examples/example1:$CLASSPATH
These values must be set for each machine hosting a distributed
Simjava component.
- Start the RMI registry on the machine where the Master program will
be run. For example, on a UNIX system,
rmiregistry &
- Start the Master program (on the same host as the RMI registry)
by executing the command
java Master registryHost registryPort #Entities
where
- registryHost
is the name of the machine where the RMI registry has been started
- registryPort
is the port that the RMI registry is listening to
- #Entities
is the number of remote simjava entities, for this example 2.
Note: the default port for RMI is 1099.
- Start the SourceSlave program be executing the command
java SourceSlave registryHost registryPort
- Start the SinkSlave program be executing the command
java SinkSlave registryHost registryPort