Remote Method Invocation(RMI)

Praveen Ramanayake
2 min readJul 18, 2020

The basic idea of Remote Method Invocation is an API that allows an object to invoke a method on an object that exists in another place. It can be on the same computer or on a different computer. by using RMI, object running in a JVM present on a client-side computer can invoke methods on an object present in another server-side JVM. There are some main concepts in Remote Method invocation such as Stub Object, Skeleton Object, RMI registry, etc.

Stub Object

Stub object used to represent (proxy) remote object at client.it consists of the object on the client system.and also it acts as a gateway for the client program. Stub does some tasks like create a connection with the remote JVM, write and send parameters to the remote Virtual Machine (JVM), etc.

Skeleton

this is an object which locates inside of the server-side as well as act as a gateway for the server-side.after the skeleton gets a request it does some specific task like read the parameter for the remote method, etc.

RMI registry

RMI registry is a namespace used to store all the server objects.RMIregistry does register all the objects at the time the server creates an object.for that purpose it uses bind() or reBind() methods.These are registered using a unique name known as bind name.

The following diagram depicts the connection between the caller a remote object

Basic connection between the caller and a remote object

--

--