Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 622
user2435860 Avatar asked Jun 02 '13 20:06

user2435860


1 Answers

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.

like image 101
Thomas Avatar answered Sep 24 '22 17:09

Thomas