RMI: What is RMI?
What is RMI?- RMI stands for Remote Method Invocation.
- It is an approach where a method on a remote machine invokes another method on another machine to perform some computation and return the result to the calling method.
What is RMI?- To interact with the methods of objects in other / remote machines using JVM, RMI is used.
- This process allows the information exchanging using multiple JVMs. It provides the location transparency by giving the sense that the methods accessing locally.
Explain the advantages and disadvantages of RMI.Advantages of RMI:
- Simple and clean to implement that leads to more robust, maintainable and flexible applications
- Distributed systems creations are allowed while decoupling the client and server objects simultaneously
- It is possible to create zero-install client for the users.
- No client installation is needed except java capable browsers
- At the time of changing the database, only the server objects are to be recompiled but not the server interface and the client remain the same.
Disadvantages of RMI:
- Less efficient than Socket objects.
- Assuming the default threading will allow ignoring the coding, being the servers are thread- safe and robust.
- Cannot use the code out of the scope of java.
- Security issues need to be monitored more closely.
Explain the architecture of RMI.RMI is based on client-server architecture model. The stub plays the role of a proxy server for the remote objects. The skeleton lives in the same JVM as the remote object and communication will be handled with the stub. The remote references are managed by the registry. The binding of server with reference to itself will be on the registry. The clients communicate with a registry which in turn obtains a remote reference to the server. This could be a remote host. The remote reference could be obtained by the client from the registry in order to invoke the methods from the remote object.
RMI vs. CORBA.- RMI and CORBA : One is not “better” than other. The comparisons between these two technologies reveals the strengths and weaknesses. The applicability of these two technologies is purely depends on the application’s demand, feasibility, performance.
- The selection of RMI or CORBA depends on the following advantages of RMI and CORBA.
- Portable across the platforms.
- Code can execute on remote JVMs.
- Existing systems can adapt RMI as this technology is available from JDK 1.02.
- Can use only the java supported platforms.
- Limited functionality because of security restrictions.
- No support for legacy systems.
- The services are non-platform and non-language dependent.
- Encourages various implementations based on the same interface.
- Supports for primitive data types and data structures as parameters.
- Provides easy ways to link between objects and systems.
- Interface Definition Language mapping needs writing for one language may not support the another language.
- New changes in the existing system / code may not integrate with the IDL language tools.
- Data transfer or objects is not supported by CORBA.
- If CORBA specifications fails for adoption by the industry, then it become legacy system.
RMI Registry service
RMI Registry service - What is RMI?, Explain the advantages and disadvantages of RMI, Explain the architecture of RMI...
RMI Remote Object
RMI Remote Object - Methods of registering and gaining access to the Remote Object, steps to create RMI-based clients and server...
RMI: Data transfer in RMI model
Data transfer in RMI model - Discuss data transfer in RMI model, What is object serialization in RMI?, What is RMI callback mechanism?..