Tech moves fast! Stay ahead of the curve with Techopedia!
Join nearly 200,000 subscribers who receive actionable tech insights from Techopedia.
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.
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.
RMI uses layered architecture:
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.