RMI understanding question
everyone. I got general idea about RMI, but still need to understand some detail开发者_开发百科s. 1) Who generates stub object: server or RMI registry? 2) Where does client get stub class to deserialize stub object? Thanks.
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().
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.
精彩评论