Question

I want to know if it is possible to pass an object by reference with java RMI.

To be more specific I want to do something like this

Client end:

server.getSomeitem(someitemID).getSomeOtherItem(otherItemId).setItemValue(String someValue);

Where on the server end the getsomeitem object returns an object with the index that is sent in, then off of that object call getsomeotheritem from that index then call setItemValue on that object.

I want this to affect that values on the server side and not just sent a copy of the objects to the client.

Is this possible?

Was it helpful?

Solution

If the object concerned is an exported remote object its (remote) reference will be passed. Otherwise the entire object is passed by value copy via Serialization.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top