The client should be implemented as an Java applet. It should have at least four text fields for displaying X, Y, their sum, and the amount for transfer. It should have labels indicating what each textfield is displaying. It should have at least three buttons: one is to read X and Y from the server, calculate their sum, and display them in the corresponding textfields; one is to send a request to the server for transferring the specified amount from account X to Y; the third one is for transferring from account Y to X. You are free to add more items, like the button for 'Quit', textfields and button letting the user specify the server name and its host name before making connections, etc.
The server should maintain two data items X and Y. Just to be simple, X, Y and the transfer amount can be always integer. It should provide methods which can be called remotely by the client to read X and Y and perform transfers. However, we want to introduce concurrency control problems into transfers, each of which is regarded as a transaction. In the server's method(s) for transfer, the server should not perform the transfer directly, instead, it must create a thread which handles the transfer as a transaction. The thread should get the amount to transfer from its parent when it is created, then it should perform the following operations on X and Y (if the transfer is from X to Y):
The thread and its methods should NOT be synchronized. Clearly, while two clients are running at the same time, the transactions they execute may be interleaved if the user deliberately manages the execution of their operations. Thus inconsistency resulted from various violations of concurrency control may appear, which is reflected by the change of the sum of X and Y when a client performs another read after the execution of the transactions.
setenv IT_CONFIG_PATH $HOME/OrbixWeb
setenv CLASSPATH .:$HOME/OrbixWeb/classes
set path = ($path /p/OrbixWeb/bin)
setenv MANPATH /p/OrbixWeb/man:$MANPATH
If your MANPATH was undefined, you should replace the last
line with
setenv MANPATH /$HOME/OrbixWeb/man
It is recommended to put the commands above into your .cshrc file.
tar -xvf /u/u29/cs542/CS542_OrbixWeb.tar
The extracted files will be in directory ~/OrbixWeb/. Do not change the directory name.
Open the file ${ORBIXWEB}/Orbix.cfg and change the values of IT_IIOP_PORT,
IT_DAEMON_PORT, IT_DAEMON_SERVER_BASE to some unique numbers, which should
be larger than 1024, of course.
Also, change the corresponding port numbers in ${ORBIXWEB}/java/Configure.java.
Also, change this particular linein the same file
'_CORBA.IT_BIND_USING_IIOP = true;' to '_CORBA.IT_BIND_USING_IIOP =
false'. Type make in the same directory.
Change all the path dependencies in the examples and Makefiles.
Change /.eros-8/p5/OrbixWeb2.0.1 to ${HOME}/OrbixWeb whereever it is
necessary.
orbixd &
to run the Orbix daemon and see if it works.
The on-line help for OrbixWeb is here. You should go to OrbixWeb Programming Guide, and read its first three chapters very carefully.
The demo for Chapter 2: Getting Started with Java Applications is now
in your directory ~/OrbixWeb/demos/grid
The demo for Chapter 3: Getting Started with Java Applets is now in
your directory ~/OrbixWeb/demos/gridApplets
To try the demos, you just need to change your current directory to
the corresponding demo directory, type
make
The demo programs will be compiled, and at the end it will tell you how to use it. Basically, you should:
killit servername
rmit servername
I recommend you to study the demo gridApplet thoroughly, take it as the basis for your project, and use similar directory structures and almost the same Makefile. The only things you may want to change in the Makefile are the server name and the package name.