【发布时间】:2013-06-15 15:37:17
【问题描述】:
我对 Java RMI 代码库属性有点困惑。
这里http://docs.oracle.com/javase/6/docs/technotes/guides/rmi/codebase.html说代码库是在客户端设置的,因为客户端可以创建某个类的自定义子类,因此服务器需要下载该类。
我是否理解客户端代码库只有在远程方法的参数之一是某个未实现远程接口的类时才重要?因为如果它正在实现远程接口服务器不需要下载任何东西,因为在服务器端会有存根。
但是为什么需要在服务器端需要代码库。它说
The client requests the class definition from the codebase. The codebase the client uses is the URL that was annotated to the stub instance when the stub class was loaded by the registry. Back in step 1, the annotated stub for the exported object was then registered with the Java RMI registry bound to a name.
如果只使用存根实现,为什么客户端需要请求存根类定义。
【问题讨论】: