Java Remote Method Invocation

What Does Java Remote Method Invocation 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 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:

  • Application layer
  • Stub and skeleton layer
  • Remote reference layer
  • Transport layer

Java RMI has numerous advantages, as follows:

  • Portable to any JVM
  • Part of Java’s write once run anywhere (WORA) approach
  • Safe and secure: Uses built-in Java security mechanisms to facilitate system safety during user download implementations
  • Easy to write/Easy to maintain: Facilitates write remote Java servers and Java clients that access those servers

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.


Related Terms

Margaret Rouse

Margaret Rouse is an award-winning technical writer and teacher known for her ability to explain complex technical subjects to a non-technical, business audience. Over the past twenty years her explanations have appeared on TechTarget websites and she's been cited as an authority in articles by the New York Times, Time Magazine, USA Today, ZDNet, PC Magazine and Discovery Magazine.Margaret's idea of a fun day is helping IT and business professionals learn to speak each other’s highly specialized languages. If you have a suggestion for a new definition or how to improve a technical explanation, please email Margaret or contact her…