Java RMI:rmic编译器生成的stub-skeleton的作用是什么 [英] Java RMI : What is the role of the stub-skeleton that are generated by the rmic compiler

查看:167
本文介绍了Java RMI:rmic编译器生成的stub-skeleton的作用是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在学习Java RMI(远程方法调用),我在其网站上遵循了Oracle提供的教程。不过我有一个特别的问题:

I am currently learning Java RMI (Remote Method Invocation), and I followed the tutorial provided by Oracle on it´s website. I have a particular question however:

rmic生成的stub-skeleton的用途是什么?我真的需要吗?

What is the use of the stub-skeleton generated by rmic? Do I really need it?

推荐答案

Stub / Skeleton隐藏了开发人员的通信细节。 Stub是实现远程接口的类。它充当远程对象的客户端占位符。存根与服务器端骨架通信。
骨架是服务器端存根的对应物。两者都通过网络进行通信。骨架实际上知道真正的远程对象将存根的请求委托给它并将响应返回给存根。
您需要两者,因为它们是RMI的基本构建块。

The Stub/Skeleton hides the communication details away from the developer. The Stub is the class that implements the remote interface. It serves as a client-side placeholder for the remote object. The stub communicates with the server-side skeleton. The skeleton is the stub's counterpart on server-side. Both communicate via the network. The skeleton actually knows the real remote objects delegates the stub's request to it and returns the response to the stub. You require both as they are the essential building blocks for RMI.

这篇关于Java RMI:rmic编译器生成的stub-skeleton的作用是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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