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

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:

主站蜘蛛池模板: 峨眉山市| 桃园市| 沈阳市| 手机| 莲花县| 鄂州市| 枣强县| 长兴县| 金寨县| 永德县| 军事| 东丰县| 嘉荫县| 马关县| 墨脱县| 吴忠市| 廊坊市| 嘉善县| 买车| 陇南市| 嘉义县| 镇雄县| 紫金县| 灵宝市| 枣阳市| 永城市| 枣阳市| 忻州市| 平原县| 鹿泉市| 黄平县| 阿城市| 巨鹿县| 揭东县| 青浦区| 宜城市| 从化市| 太白县| 连城县| 井研县| 陆良县|