• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Method serialization

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi:
How can I send a serialized method invoction via socket.
I don't want to execute it remotly on the server, but just need to inform a server of the methods a client invoked.
But that isn't all:
The server, when getting the information of an invoation, needs to distribute and execute it on other clients (via socket).
In other words, the method invokation from a client A, is distributed by an server S and executed on clients A, B, C, D.
I need to know:
1) How to serialize the method and the arguments (I just know how to serialize the argmuents)
2) How to execute the methods on clients A, B, C, D when recieving the servers order.
Thanks.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Methods cannot be serialized in Java, only objects can be serialized.
Regarding your second question, the solution is having a controller class on each of the otherclients, B, C and D whose only purpose is to call the desired method. This class would have static information of method names or implement reflection to call the appropriate object and its method.
Once A calls on a method on S, then S has to lookup on this remote object and pass it the method name as a string. This distributed remote object will then call upon the particular objects method on clients, B, C and D.
Hope that helps :-),
for more info,
pls contact me on
balaji@net4nuts.com

------------------
Balaji Iyer,
System Architect,
Net4nuts.com
Ahmedabad
"If you want to make God Laugh, Tell HIM your plans !! "
 
Tell me how it all turns out. Here is a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic