Java Remote Method Invocation (Java RMI)

Definition - What does Java Remote Method Invocation (Java RMI) mean?

Java Remote Method Invocation (Java RMI) is a mechanism that allows one Java Virtual Machine (JVM) running object to invoke methods on an object running in another JVM. It facilitates the remote calling of Java object methods and sharing of resources and services.

Techopedia explains Java Remote Method Invocation (Java RMI)

Java RMI is a technological mechanism in which a server and client communicate and pass information while relying on the Java Remote Method Protocol (JRMP). Java relies heavily on Java object serialization, which allows the transmission of objects as a stream. RMI also allows a client and server to load new object types dynamically, as required.

Consider this scenario: User A creates a class, which has methods that provide a specific service. User B wants to user A's service. Through Java RMI, user B is able to invoke the object's method. User A places the service in the registry. User B is unaware of the service location, so it invokes the RMI registry. The registry then locates the service, which invokes the method.