Remote Method Invocation (RMI)

SENG 41283 — Distributed and Cloud Computing

Nuwan Alawatta
3 min readJul 18, 2020

RMI (Remote Method Invocation) is a way for a programmer to write object-oriented programming using the Java programming language and development environment, in which objects on different computers can communicate in a distributed network. RMI is the Java equivalent of what is commonly known as the Remote Procedure Call (RPC), but with the ability to move along with the request one or more objects.

RMI

Stub

A stub for a remote object acts as a local representative of a client or a proxy for the remote object. The caller invokes a function which is responsible for executing the method call on the remote object on the local stub. In RMI, a stub for a remote object implements the same set of remote interfaces as implemented by a remote object.

Skeleton

The skeleton is an entity, the server-side entity serves as a portal. The skeleton is responsible for dispatching the call to the actual implementation of a remote entity.

RMI Registry

The RMI registry is basically a place for the server to register services it provides and a place for the clients to ask for those services.

Remote Interface
Remote Implementation
Server Application
Client Application
Testing RMI Application

According to the example application, we can summarize the learnt RMI basic concepts. Remote invocation method allows programs to call remotely located object methods, share resources and process load across systems. Unlike other remote execution systems that require that only specific data types or specified structures be transferred to and from methods, RMI allows any form of Java object to be used even if the client or server has never seen it before.

--

--

Nuwan Alawatta

Senior Software Engineer | SyscoLABS SL | BSc. (Hons.) in Software Engineering | University of Kelaniya ::: https://nuwan.dev