Passing Objects In RMI
1 posts in topic
Flat View  Flat View

Posted By:   SaraswatiBhatla_Chakradhar
Posted On:   Tuesday, October 29, 2002 07:42 PM

According to core java we pass Objects by reference only.
is the same rule apply for RMI also ? Could anybody please explain ?

Re: Passing Objects In RMI

Posted By:   Lasse_Koskela  
Posted On:   Tuesday, October 29, 2002 11:25 PM

When you obtain an object from a remote RMI server, you don't get the object you binded to the registry but instead a proxy class, which communicates all the method calls you make over the network to the RMI server, which in turn forwards the method calls to the real object. So basically, you could say you're getting a reference to the remote object.

But if you call a remote method like doSomething(MyObject obj), obj is passed by value, not by reference (as it's not a proxy class).

Hope this cleared up the issue a bit.

About | Sitemap | Contact