/RMIService

An RMI (Remote Method Invocation) facility similar to Java RMI

Primary LanguageJava

{\rtf1\ansi\ansicpg1252\cocoartf1187
{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fswiss\fcharset0 ArialMT;}
{\colortbl;\red255\green255\blue255;}
\margl1440\margr1440\vieww25400\viewh14520\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural

\f0\fs24 \cf0 FILE AND DIRECTORY ORGANIZATION:\
\
1. src  -  Contains the source files with package names.\
2. build.xml  -   Apache Ant build file for building the project.\
3. 15440-RMI-Report.pdf  -  The lab report describing the framework.\
4. README.rtf - this file.\
\
\
BUILD:\
In order to build the framework, execute the following command:\

\f1 \
\pard\pardeftab720
\cf0 	
\b ant clean compile jar
\b0 \
\
This creates an executable jar in ./build/jar\
\
\
EXECUTE:\
\
All the commands below are relative to the directory where the src, run, and the newly created build directories exist.\
\
-->After running the build command above, run the following command on the node that should act as the application server and registry:\
\
	
\b java -cp ./build/jar/RMIService.jar rmiservice.rmi.server.yourRMI <hostname> <dispatcher-port> <registry-port> <interface-names\'85>\

\b0 \
For example:\
\
	j
\b ava -cp ./build/jar/RMIService.jar rmiservice.rmi.server.yourRMI ghc52.ghc.andrew.cmu.edu 12345 50000 CalculatePi ZipCodeServer\

\b0 \
Here, \
\
	
\b ghc52.ghc.andrew.cmu.edu 
\b0 is the host you are running this command, and hence the server on.\
	
\b 12345 
\b0 is the port which the dispatcher (application server) will listen to.\
	
\b 50000 
\b0 is the port on which the registry service will be hosted.\
	
\b CalculatePi 
\b0 and 
\b ZipCodeServer 
\b0 are the names of the interfaces that are provided as a service to the client.\
\
-->Next, run the client code for CalculatePi or ZipCodeServer on any other machine using the following command:\
\
	
\b java -cp ./build/jar/RMIService.jar rmiservice.rmi.client.<ClientName> <server-name> <registry-port> <interface-name> [<arguments>]\

\b0 \
For example:\
\

\b 	java -cp ./build/jar/RMIService.jar rmiservice.rmi.client.CalculatePiClient ghc52.ghc.andrew.cmu.edu 50000 CalculatePi\
OR\
	java -cp ./build/jar/RMIService.jar rmiservice.rmi.client.ZipCodeClient ghc52.ghc.andrew.cmu.edu 50000 ZipCodeServer ./src/rmiservice/rmi/client/ZipList
\b0 \
\
\
AVAILABLE APPLICATIONS:\
1. 
\b ZipCodeServer: 
\b0 The client reads the ZipList file located in the client directory, initializes a list of city-zip code combinations using the ZipCodeList ADT. \
It then passes this list to the server, which initializes a local list as well. The client then calls methods that find one or more zip codes corresponding to one\
or more cities, and prints them on the server as well.\
2. 
\b ComputePi: 
\b0 This is an interactive program which takes an integer from the user, and returns the value of PI up to those many decimal places. If the user enters\
a negative number, the initialize method generates throws an exception, which is conveyed to the client in the form of a RemoteException. This program, thus is used mainly\
to test the functionality of how the RemoteException works. The user can enter 0 to quit the program. \
NOTE: We have taken the 'logoc' to compute Pi to n decimal digits from Java's Oracle website. This does not affect how our RMI works in any way, including the generation\
and reporting of the remote exception. The code taken from the website consists only the logic of computing PI.\
}