Without having any experience with Java RMI, I have a naive question, but am still not sure about the answer after searching the internet.
Question:
To me, there are two scenarios:
Scenario-1: Start a Java program from local, during its execution, it calls a method from a class stored on a remote machine, then the class of that method would be downloaded to the local machine, and resume executing.
Scenario-2: Start a Java program from local, during its execution, it calls a method from a class stored on a remote machine, then that method will be executed on the remote machine, and the results will be sent back to the local machine. (Does this require class/object transfer?)
Which one does Java RMI use? or neither?
From Wikipedia of RPC: "RPC allows a computer program to cause a subroutine or procedure to execute in another address space (commonly on another computer on a shared network)", it seems it is the 2nd scenario.
But according to this paper Reducing Data Transfer during Remote Classloading in Java RMI, it seems it is the 1st scenario.