Passion of IT

Remote Method Invocation

The first way invented to allow at computer client to call a remote method present on the computer server was RMI, after was created the middleware CORBA and now the most used way to make the communication between client and server is web services.

 

A middleware is another layer of iso-osi that is over the fourth layer (transport) and has this two functions:

  • hides how client and server exchange data because client sends  message to  local proxy called stub, this stub sends message to proxy on server called skeleton and skeleton sends message to remote app on computer server.
  • Allows to communicate different and heterogeneous architecture, software because uses a IDL (interface definition language) for making an interface, for this reason, the implementation is independent from the language used

The first type of middleware was CORBA (common request object architecture), it is  made of Remote procedure call but now the most used middleware to exchange data between hosts is web services.

In this article I want to explain what is Remote Method Invocation, so it is a call of remote procedure (Remote procedure call RPC used on java).

rmiScheme

All methods published on server are registered on RMI Registry (like UDDI for web services). I have written below the steps to perform the RMI call.

  • client calls the local method (stub) to perform this operation
  • the stub on computer client calls RMI Registry to know whether that method exists and the correct way to call it
  • client stub calls this method on server
  • server skeleton receives this request and communicate with the software on server,  when it receives the response, sends this response to the client stub.

I made a simple software called RMI Echo that allows the client to send a string on server and server returns the same string to the client.

This software was made of the classic J2EE technology without graphical interface because this is the first software without GUI (it is one my target) and also because it is easy to use: it is enough to run these two java files:

RMI Project

 

  • First of all it is necessary to run RMI registry by typing a command rmiregistry
  • The second step is to run server
  • The third step is to run client with two parameters: IP and string to pass to server (the second element of the socket, the address of TCP so the port number is fixed=25725 to simplify the operations)
  • The string is sent to the server and this server sends this string on the client.

when you use RMI in java web application classic it is not necessary to run RMIRegistry

this resource is available here

No Comments Yet

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite="
"> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Recent Comments

Michele Rizzithe website doesn't exist. Ara you a robot? In any case it's difficult that an automatic system writes a comment here since there are two captchas...
Hello there! This is kind of off topic but I need some guidance from an established blog. Is it very hard to set up your own blog? I'm not very t...
We are a group of volunteers and opening a new scheme in our community. Your web site offered us with valuable information to work on. You've done a...
March 2024
M T W T F S S
« Dec    
 123
45678910
11121314151617
18192021222324
25262728293031

Login