0

everyone. I got general idea about RMI, but still need to understand some details. 1) Who generates stub object: server or RMI registry? 2) Where does client get stub class to deserialize stub object? Thanks.

Konstantin Milyutin
  • 10,842
  • 11
  • 53
  • 77

1 Answers1

1
  1. RMI creates the stub when you export your remote object. If it extends UnicastRemoteObject this occurs on construction, otherwise it occurs when you call exportObject().

  2. As you aren't using rmic, the stub class is a dynamic proxy: java.lang.reflect.Proxy. The client already has that class in the JRE. So the client only needs the remote interface class and any application classes that it depends on, and so on recursively until closure.

user207421
  • 289,834
  • 37
  • 266
  • 440