• Post Reply Bookmark Topic Watch Topic
  • New Topic

Am I correct ?

 
Vladan Radovanovic
Ranch Hand
Posts: 216
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Everyone,
I just need some clarification regarding RMI and types that can be passed as parameters or returned in RMI.
primitives(byte, boolean, char ...) are passed by value ?
serializable types ( classes that implement java.io.Serializable) are passed by value ???
remote types ( classes that implement java.rmi.Remote) are passed by reference ???
Please some of the java gurus(jply or other moderators here or anyone) reply.
Thank You
Vladan
[This message has been edited by Vladan Radovanovic (edited January 08, 2001).]
 
Jerry Pulley
Ranch Hand
Posts: 221
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vladan,
Correct on all counts; I'll elaborate a little since you called me a guru. (BTW, do I get a raise?)
When you use a remote reference as a parameter or return value, the stub for the object referred to is passed. The effect is as if you actually passed the reference itself. It has to be a reference to an actual exported remote object, not just a reference to an object of a class that implements <code>Remote</code>.
Anything else is passed by value (that is, by copy) using serialization. Primitive types are automatically serializable; other types must implement <code>Serializable</code>.
Jerry
 
Vladan Radovanovic
Ranch Hand
Posts: 216
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank You
Vladan
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!