简体   繁体   English

在RMI客户端上具有存根类的目的是什么?

[英]What is the purpose of having the stub class on RMI client?

What is the point of dynamically loading the stub class onto the RMI client? 将存根类动态加载到RMI客户端的意义何在? The stub which acts as a proxy for remote object is used by the client to call remote methods, but if we load the stub class, we have the class in the client VM. 客户端使用该存根作为远程对象的代理,以调用远程方法,但是如果我们加载存根类,则该类在客户端VM中。 Doesn't this make it like a local method call, since the client has the entire stub class? 因为客户端具有整个存根类,这是否使它像本地方法调用一样?

Dynamic class loading RMI 动态类加载RMI

What is the point of dynamically loading the stub class onto the RMI client? 将存根类动态加载到RMI客户端的意义何在?

It simplifies the deployment problem. 它简化了部署问题。 You don't have to distribute the stub class. 您不必分发存根类。 Since dynamic stubs were introduced in Java 1.5, dynamic stub loading is of diminished importance. 由于Java 1.5中引入了动态存根,因此动态存根加载的重要性已降低。

Doesn't this make it like a local method call, since the client has the entire stub class? 因为客户端具有整个存根类,这是否使它像本地方法调用一样?

Of course, but then the called method in the stub class engages in the RMI network protocol to delegate it to the remote object. 当然,但是随后存根类中的被调用方法将参与RMI网络协议以将其委派给远程对象。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM