• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to pass non-remote object parameter

 
batusai himura
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
good day,
1. hi im new to java and rmi, and i need help pls, my question is how can i pass a non-remote object/local object as a parameter to a remote method. can u pls give a code for the:
a. client that will invoke the remote method and pass the object in remote objects method.
b. object that will be passed to the server/remote object( a serilizable object of course).
c. the remote object and the method that will receive the object parameter.
2. do i have to create a seriliazable object to pass in the client side and in the server side? or just in the client side? if so how is passing the object happens?
thank you very much for your kindness,

p.s.
you can email me to batusai_3rd@yahoo.com
batusai,
 
Joe Ess
Bartender
Posts: 9362
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The answer to question 1 is simply that you can pass any serializable object in a method on a remote object. Look through the RMI Tutorial for some examples.
The passing of the object is done with serialization. when you invoke the remote object's method, the serializable argument object is decomposed, sent across the network, recomposed and passed into the remote implementation object's method. Same thing happens on the return trip.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!