|
|
|
|
The Java RMI Tutorial says, at http://java.sun.com/docs/books/tutorial/rmi/implementing.html
:
Arguments to or return values from remote methods can be of almost any
type, including local objects, remote objects, and primitive data types. More
precisely, any entity of any type can be passed to or from a remote method as
long as the entity is an instance of a type that is a primitive data type, a
remote object, or a serializable object, which means that it implements
the interface Some object types do not meet any of these criteria and thus cannot be
passed to or returned from a remote method. Most of these objects, such as
threads or file descriptors, encapsulate information that makes sense only
within a single address space. Many of the core classes, including the classes
in the packages The rules governing how arguments and return values are passed are as follows:
Passing a remote object by reference means that any changes made to the state of the object by remote method invocations are reflected in the original remote object. When a remote object is passed, only those interfaces that are remote interfaces are available to the receiver. Any methods defined in the implementation class or defined in non-remote interfaces implemented by the class are not available to that receiver. ... In the parameters and return values of remote method invocations, objects that are not remote objects are passed by value. Thus, a copy of the object is created in the receiving Java virtual machine. Any changes to the object's state by the receiver are reflected only in the receiver's copy, not in the sender's original instance. Any changes to the object's state by the sender are reflected only in the sender's original instance, not in the receiver's copy. |
| The page was last updated February 19, 2008 |