What is the difference between RMI and JRMP?

Asked

Viewed 567 times

3

I only know the MRI... JRMP is just a different way of calling the RMI or is another protocol?
If JRMP is another protocol, what is the difference with the RMI?

1 answer

1


RMI

The RMI (Remote Method Invocation) is a programming interface that allows RPC-style remote call execution in applications developed in Java. It is one of the approaches of the Java platform to provide the functionality of a distributed object platform. This system of distributed objects has been part of the core of Java since the version JDK 1.1, with your API being specified through the package java.rmi and its subpackages.

Through the use of the RMI architecture, it is possible that an active object in a Java virtual machine can interact with objects from other virtual machines Java, irrespective of the location of such virtual machines.

JRMP

JRMP (Java Remote Method Protocol) is the specific protocol of Java technology to look up and refer to remote objects. It is a wire-level protocol running at a level below RMI (RMI) and through TCP/IP.

RMI System Software Layers

The implementation of the RMI is essentially made up of three layers of abstraction. The layer Stub and Skeleton is below the eyes of the developer. This layer intercepts the methods calls made by the client so that the interface reference variable redirects those calls to the remote RMI service.

The next layer is the Remote Reference Layer. This layer knows how to interpret and manage references made from clients to remote service objects. The client’s connection to the server is Unicast (one-on-one).

The transport layer is based on the connections TCP/IP between machines in a network. Using this layered architecture, each layer could be easily improved or replaced without affecting the rest of the system. For example, the transport layer could be replaced by a layer that implements UDP/IP connections, without affecting the upper layers.

This layer deals directly with communication between the various JVM’s, using TCP/IP. It is important to note that even if JVM’s are executed on the same computer, the RMI always uses TCP/IP communication. This means that it is always necessary to have a functional network interface to be able to use RMI (even if the client application and the server application are running on the same computer). On the TCP/IP stack the RMI has a protocol called JRMP, and it allows to overcome some obstacles that may arise in the network communication via TCP/IP. For example, JRMP allows you to multiplex multiple TCP/IP connections on a single TCP/IP connection by exceeding single connection usage constraints in some environments (e.g.: certain browsers running RMI applets)


Java RMI is not exactly a transport protocol?

No. Java RMI is a set of Apis and a model for remote objects that allows developers to easily build distributed Java applications. For example, it uses normal Java interfaces to define remote objects in a separate language such as IDL. Usually Java RMI uses a combination of Java serialization and the Java Remote Method Protocol (JRMP) to convert the normal appearance of a method into a remote method invocation.

With Java RMI, JRMP will continue to support and improve the native protocol for Java RMI.

Which is a transport protocol?

A transport protocol defines a set of message formats that allow data to be passed through a network from one computer to another. Java RMI supports its own transportation protocol (JRMP) and other regular industry protocols including IIOP.

See more in: Java: Remote Method Invocation

  • Compelled by Attention , could further clarify this part : "It’s a working wire-level protocol ..."

  • @Penada pintada, is translation to the letter of "Wire level Protocol". In a network, a wire protocol is the data transmission mechanism from point A to point b. The term is a bit confusing, because it sounds like layer 1 of the network, which physically places the bits "on the wire". In some cases, it may refer to layer 1; however, it usually refers to higher layers including Ethernet and ATM (layer 2) and even higher distributed layer object protocols such as SOAP, CORBA or RMI.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.