Parameters for Remote Methods

As just stated, RMI serializes parameters in remote method calls. Actually, RMI passes two different types of entities in method calls:

  • Serialized objects—These are serialized copies of the local value the client uses as a parameter to the remote method.

  • Remote references—If the parameter of a remote method is a remote object, defined and instantiated on the client side, RMI sends a remote reference (stub) as a marshalled parameter—not a copy of the object.

This distinction is very critical to the performance of your RMI applications. If you send small values, such as a string that represents a birth date or telephone number, it will not result in a very significant data transfer of marshalled data.

If, on the other ...

Get PURE Java™ 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.