70 likes | 134 Views
<br>The RMI (Remote Method Invocation) is an API that provides an operation to make assigned put in Java. The RMI allows an product to produce Methods on an product working in another JVM.
E N D
SUBJECT What is RMI?
What is RMI? The RMI (Remote Method Invocation) is an API that provides an operation to make assigned put in Java. The RMI allows an product to produce Methods on an product working in another JVM. The RMI provides remote relationships between the programs using a couple of aspects stub and skeleton. Understanding stub and skeleton RMI uses stub and skeleton product for relationships with the remote product. A remote technique an product whose technique can be invoked from another JVM. Let’s understand the stub and skeleton objects:
RMI Example 1) make the remote interface For creating the remote interface, increase the Remote interface and declare the RemoteException with all particularly of the remote interface. Here, we are creating an online interface that extends the Remote interface. There is only one method named add() and it states RemoteException. 2) Provide the execution of the remote interface Now provide the execution of the remote interface. For providing the execution of the Remote interface, we need to Either increase the UnicastRemoteObject category, or use the exportObject() method of the UnicastRemoteObject class In case, you increase the UnicastRemoteObject category, you must define a constructor that states RemoteException. 3) make the stub and skeleton things using the rmic device. Next step is to make stub and skeleton things using the rmi compiler. The rmic device invokes the RMI compiler and creates stub and bones things. 4) Start the computer registry service by the rmiregistry
Stub Stub The stub is a product, provides an access for the customer part. All the confident specifications are directed through it. It prevails at the customer part to signify the remote product. When the actual creates technique on the stub product, it does the following tasks: It activates a connection with Virtual Machine (JVM), It creates and provides (marshals) the aspects to the Virtual Machine (JVM), It stays for the result It goes (unmarshals) the come back value or exemption, and It finally, returns the value to the actual. skeleton
skeleton skeleton The skeleton is a product, provides an access for the server part product. All the inbound specifications are directed through it. When the skeleton gets the inbound need, it does the following tasks: 1. It goes the parameter for the remote method 2. It helps make the process on the particular remote product, and 3. It creates and provides (marshals) the lead to the actual. Understanding specifications for the assigned applications If any system performs these tasks, it can be assigned system.
Create and run the server application Now rmi services need to be organised in a server process. The Labeling category provides ways to get and store the remote item. The Labeling category provides 5 techniques.