Search This Blog

Showing posts with label rmi program. Show all posts
Showing posts with label rmi program. Show all posts

Remote Method Invocation (RMI) in Java - Example Program to Calculate Power using RMI

Remote Proceure Call (RPC) is a protocol by which a computer can call a function in another computer connected through network. The caller passes arguments through network and the callee executes the function and returns the output to the caller. In object oriented languages we use RMI (Remote Method Invocation) instead of RPC. Let us see a sample java program which uses RMI. .

Here, we call the computer that hosts the method, a server. And those computers which call this method are called clients. More precisely, RMI server and RMI clients. RMI clients call remote methods in RMI servers.

Our example program is answer to the following question:
Write a java program that uses RMI in which RMI clients can calculate powers of numbers by invoking a remote method in RMI server.