your source for information about Java..
|
This is a small example to demonstrate the pass-by-value concept in RMI. Real state is passed by over the wire instead of references like in CORBA e.g. More important it also demonstrates that stubs are transmitted over the wire so objects can really move from one server to another ( agent-like behaviour ).
A baby cries and needs help. The mother receives the getHelp from the baby but instead of help it returns a reference to the Nanny which can provides help to the Baby. The baby then calls the getHelp to the Nanny and gets help. Normal scenario :
The whole point of this exercise is : Does Baby use Mother to communicate to Nanny, since it does not look for a reference to Nanny in the registry, or does it get the stub of Nanny through the mother and after that Baby does not longer need the Mother. One scenario to test/demonstrate this is killing the mother after the baby gots the reference of the Nanny :
Source-code : © 2000 Sun Microsystems - Dieter Deramoudt |
Feedback, comments : [email protected]