-3

I'm trying to send an object from client side to server side in order to modify its attributes and send it back from server to client - but without using a stub.

Any ideas?

user207421
  • 305,947
  • 44
  • 307
  • 483
  • 4
    Hello and welcome to StackOverflow. Please take some time to read the help page, especially the sections named ["What topics can I ask about here?"](http://stackoverflow.com/help/on-topic) and ["What types of questions should I avoid asking?"](http://stackoverflow.com/help/dont-ask). And more importantly, please read the Stack Overflow [question checklist](http://meta.stackexchange.com/q/156810/204922). You might also want to learn about [Minimal, Complete, and Verifiable Examples](http://stackoverflow.com/help/mcve). – Abdullah Khan Apr 24 '17 at 13:41
  • 1
    I don't think you should tag this with RMI if you don't intend to use a stub. – user1803551 Apr 24 '17 at 13:58

2 Answers2

1

Sure:

  • define your own protocol to enable remote calling
  • serialize the object on the one side into a stream of bytes, or more 2017ish: into a JSON string
  • send the bytes / string to the other side
  • deserialize, update; serialize and sent back.

That is a pretty generic answer; but given your extremely broad input; the best you can hope for (imho).

Further reading: on protocols, on serialization.

Community
  • 1
  • 1
GhostCat
  • 137,827
  • 25
  • 176
  • 248
0

You don't need a stub class in the sense of generating one with rmic. Study the preamble to the Javadoc for UnicastRemoteObject for the conditions under which a dynamic stub is generated automatically.

user207421
  • 305,947
  • 44
  • 307
  • 483