Java RMI : What is the role of the stub-skeleton that are generated by the rmic compiler

拈花ヽ惹草 提交于 2019-12-04 13:19:03

问题


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:

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


回答1:


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.



来源:https://stackoverflow.com/questions/16886889/java-rmi-what-is-the-role-of-the-stub-skeleton-that-are-generated-by-the-rmic

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!