File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Remote object parameters transferred between client and server

 
sarah Marsh
Ranch Hand
Posts: 282
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 124
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 282
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 124
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In that case, the class should implement Serializable like

Ashwin.
[This message has been edited by Ashwin Desai (edited March 27, 2001).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic