**5. Remote method invocation**

Remote method invocation is a technology introduced by java that allows invocation of methods that are remotely located by simply calling them using desired interfaces. RMI technology allows us to distribute over business logic i.e. making the business logic available on a remote server letting it accessible to clients [14].

RMI is often called as "RPC with object orientation", i.e. the RPC but with ability to pass one or more objects along with the request. The objects can include the information that will change the service that is performed in the remote computer as delineated in **Figure 8**.

For example, when a user at a remote computer fills out an expense account, the Java program interacting with the user could communicate, using RMI, with a Java program in another computer that always had the latest policy about expense reporting. In reply, that program would send back an object and associated method information that would enable the remote computer program to screen the user's expense account data in a way that was consistent with the latest policy [15]. The user and the company both would save time by catching mistakes

early. Whenever the company policy changed, it would require a change to a program in only

Evolution and Paradigm Shift in Distributed System Architecture

http://dx.doi.org/10.5772/intechopen.80644

15

**a.** Stub/Skeleton layer: A stub program represents the remote object and also acts as gateway to a corresponding skeleton at the server end. The stub appears to the calling program to

**b.** Remote reference layer: This can behave differently depending on the parameters passed by the calling program. For example, this layer can determine whether the request is to call

**c.** Transport connection layer: This sets up and manages the request. A single request travels down through the layers on one computer and up through the layers at the other end. RMI Registry is a central repository keeping a track of all services being exposed from the current network. Since all the clients' requests for services through the RMI Registry the location of the application or service is unknown to the clients hence making the application location

Typically, code on demand is used for any technology that sends executable code from a server host to a client host on the request of the client's application. Code on demand is a

a single remote service or multiple remote programs as in a multicast.

RMI is implemented as three layers (as illustrated in **Figure 9**):

be the program being called for a service.

**6. Code-on-demand paradigm**

one computer (**Table 1**).

**Figure 9.** Event flow in RMI.

neutral [16].

**Figure 8.** Remote method invocation.


**Table 1.** RMI v/s RPC difference table.

Evolution and Paradigm Shift in Distributed System Architecture http://dx.doi.org/10.5772/intechopen.80644 15

**Figure 9.** Event flow in RMI.

**5. Remote method invocation**

14 New Trends in Industrial Automation

server letting it accessible to clients [14].

**RMI RPC**

**Table 1.** RMI v/s RPC difference table.

**Figure 8.** Remote method invocation.

Location neutral, language dependent Language neutral mechanism

It allows objects passing as arguments and return values It supports only primitive data types

Supports object oriented design It is procedural like C

This allows usage of design patterns No such capability

Remote method invocation is a technology introduced by java that allows invocation of methods that are remotely located by simply calling them using desired interfaces. RMI technology allows us to distribute over business logic i.e. making the business logic available on a remote

RMI is often called as "RPC with object orientation", i.e. the RPC but with ability to pass one or more objects along with the request. The objects can include the information that will change the service that is performed in the remote computer as delineated in **Figure 8**.

For example, when a user at a remote computer fills out an expense account, the Java program interacting with the user could communicate, using RMI, with a Java program in another computer that always had the latest policy about expense reporting. In reply, that program would send back an object and associated method information that would enable the remote computer program to screen the user's expense account data in a way that was consistent with the latest policy [15]. The user and the company both would save time by catching mistakes

> early. Whenever the company policy changed, it would require a change to a program in only one computer (**Table 1**).

RMI is implemented as three layers (as illustrated in **Figure 9**):


RMI Registry is a central repository keeping a track of all services being exposed from the current network. Since all the clients' requests for services through the RMI Registry the location of the application or service is unknown to the clients hence making the application location neutral [16].
