File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Distributed Java and the fly likes Remote object parameters transferred between client and server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "Remote object parameters transferred between client and server" Watch "Remote object parameters transferred between client and server" New topic
Author

Remote object parameters transferred between client and server

sarah Marsh
Ranch Hand

Joined: Mar 06, 2001
Posts: 282
Remote object parameters transferred between client and server
using Java Serialization. In this case, both client and server
must implement the Serializable interface, right?
But when I read some of RMI code, like the code in "Getting
Started Using RMI" on http://java.sun.com/j2se/1.3/docs/guide/rmi/getstart.doc.html,
there does not implement the Serializable interface at all,
so how remote object parameters transferred between client
and server in those examples?

Please help ASAP !!!
Thanks in advance,
Sarah
Ashwin Desai
Ranch Hand

Joined: Jul 17, 2000
Posts: 124
Hi,
The client and the server need not implement the Serializable interface. The following are requirements for RMI:
1) Server class implements Remote.
2) Classes that are passed as parameters and return types need to be implementing Serializable.
All the java.lang classes like String, Integer etc already implement Serializable. Thus, if you are using user defined classes, that class should implement the Ser... interface.
Hope this helps.
Ashwin.
sarah Marsh
Ranch Hand

Joined: Mar 06, 2001
Posts: 282
Thank you for your answer, Ashwin.
What if the passed parameters and return types are objects created by programmers, how to implement Serializable?
Ashwin Desai
Ranch Hand

Joined: Jul 17, 2000
Posts: 124
In that case, the class should implement Serializable like

Ashwin.
[This message has been edited by Ashwin Desai (edited March 27, 2001).]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Remote object parameters transferred between client and server