我们真的需要在java RMI中创建Stub吗? [英] Do we really need to create Stub in java RMI?

查看:252
本文介绍了我们真的需要在java RMI中创建Stub吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读一些RMI文档,所有书籍都说我们需要为客户端创建Stub才能与服务器通信。
然而,我试图不创建存根,事情就像一个魅力。我把客户端程序放在一台机器上,服务器放在另一台机器上,事情很完美。
那么,创建Stub的目的是什么呢?我们真的需要创建一个吗?
谢谢。

I am reading some RMI document and all the books say that we need to create Stub for the client in order to communicate with the server. However, I have tried to not create stub and things worked like a charm. I have put the client program on one machine and the server on another, things worked perfectly. So, what is actually the purpose of creating Stub and do we really need to create one? Thanks.

推荐答案

从Java 1.5开始,您不必:

Since Java 1.5 you don't have to:


此版本增加了对在运行时动态生成存根类的支持,无需使用[...]存根编译器,rmic ,为远程对象预生成存根类。请注意,rmic仍然必须用于为需要支持在早期版本上运行的客户端的远程对象预生成存根类。

This release adds support for the dynamic generation of stub classes at runtime, obviating the need to use [...] stub compiler, rmic, to pregenerate stub classes for remote objects. Note that rmic must still be used to pregenerate stub classes for remote objects that need to support clients running on earlier versions.

来自 http://download.oracle.com/javase/1.5.0 /docs/guide/rmi/relnotes.html

这篇关于我们真的需要在java RMI中创建Stub吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆