RMI:
- The remote objects are accessed by the references
- Implements object to object implementation among different java objects to implement distributed communication model.
– RMI passes the objects as parameters to remote methods.
– RMI invokes the remote methods from the objects
RPC:
- The process is through methods / functions
- Proxy server is involved in processing the procedure calls
- Calls a procedure remotely like invoking the methods
- The remoteness is not exactly transparent to the client
1.
2. RMI
3. RMI中,远程接口使每个远程方法都具有方法签名。如果一个方法在服务器上执行,但是没有相匹配的签名被添加到这个远程接口上,那么这个新方法就不能被RMI客户方所调用。在RPC中,当一个请求到达RPC服务器时,这个请求就包含了一个参数集和一个文本值,通常形成“classname.methodname”的形式。这就向RPC服务器表明,被请求的方法在为“classname”的类中,名叫“methodname”。然后RPC服务器就去搜索与之相匹配的类和方法,并把它作为那种方法参数类型的输入。这里的参数类型是与RPC请求中的类型是匹配的。一旦匹配成功,这个方法就被调用了,其结果被编码后返回客户方。