Passing parameters in RMI
by, 01-02-2012 at 07:36 PM (2769 Views)
• By value, primitive types get passed. For example, Boolean, char, int etc.
• Being remote references, remote object references get passed which permits the client process to make the methods invoked.
• By object serialization, non remote objects get passed by value. Implementation of the java.io.Serializable interface shall take place which shall allow objects to get serialized.
Remote method’s invocation gets initiated by the client process, using calling method present at stub. There exists reference of the stub to the remote object and calls are being forwarded to skeleton via reference manager by method argument marshalling. All objects are being checked during marshalling to find out that java.rmi.Remote interface is implemented or not. Remote references are used in case it is implemented. Otherwise, serialization of the object takes place into byte streams and is sent for remote process to get it de-serialized to local object copy. From stub, this request is converted by skeleton to appropriate method call by un-marshallization of the method argument, to local stubs present at server or to local copy.