Remote Method Parameters

RMI imposes one significant restriction on the types of objects you can use in remote method invocations (either as parameters or return values). You can pass any of the native types (int, float, double, boolean, and so on) but any objects you pass must implement java.io.Serializable or java.rmi.Remote.

When you pass a serializable (local) object as an RMI parameter, the object is referred to as a non-remote object. That is, the entire object goes from the client to the server or from the server to the client. When you pass a remote object as an RMI parameter, on the other hand, RMI passes a remote reference. That is, instead of passing in an entire object, RMI passes what eventually becomes a stub. The remote object ...

Get Special Edition Using Java™ 2 Enterprise Edition 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.