官术网_书友最值得收藏!

Key terminologies of RMI

The following are some of the important terminologies used in a Remote Method Invocation.

Remote object: This is an object in a specific JVM whose methods are exposed so they could be invoked by another program deployed on a different JVM.

Remote interface: This is a Java interface that defines the methods that exist in a remote object. A remote object can implement more than one remote interface to adopt multiple remote interface behaviors.

RMI: This is a way of invoking a remote object's methods with the help of a remote interface. It can be carried with a syntax that is similar to the local method invocation.

Stub: This is a Java object that acts as an entry point for the client object to route any outgoing requests. It exists on the client JVM and represents the handle to the remote object. If any object invokes a method on the stub object, the stub establishes RMI by following these steps:

  1. It initiates a connection to the remote machine JVM.
  2. It marshals (write and transmit) the parameters passed to it via the remote JVM.
  3. It waits for a response from the remote object and unmarshals (read) the returned value or exception, then it responds to the caller with that value or exception.

Skeleton: This is an object that behaves like a gateway on the server side. It acts as a remote object with which the client objects interact through the stub. This means that any requests coming from the remote client are routed through it. If the skeleton receives a request, it establishes RMI through these steps:

  1. It reads the parameter sent to the remote method.
  2. It invokes the actual remote object method.
  3. It marshals (writes and transmits) the result back to the caller (stub).

The following diagram demonstrates RMI communication with stub and skeleton involved:

主站蜘蛛池模板: 玉门市| 保亭| 芮城县| 银川市| 油尖旺区| 玉山县| 阿荣旗| 灵台县| 娄烦县| 腾冲县| 娄底市| 嫩江县| 句容市| 宝鸡市| 华坪县| 湟中县| 花垣县| 双桥区| 榆树市| 黔西县| 大埔区| 神农架林区| 巴林右旗| 建昌县| 依安县| 汪清县| 平塘县| 敦化市| 全南县| 唐海县| 日喀则市| 普定县| 宝兴县| 建昌县| 五河县| 古丈县| 库伦旗| 磐安县| 新巴尔虎右旗| 兴城市| 溆浦县|