Logo F2FInterview

RMI Interview Questions

Q   |   QA

RMI registry is the binder for Java RMI. An instance of RMI registry must run on every server computer that hosts remote objects. It maintains table mapping textual, URL style names to refer remote objects hosted on that computer. Naming class provides methods for RMI registry :

rebind(String name, Remote object)
bind(String name, Remote object)
unbind(String name, Remote object)

The OSagent is a process that allows CORBA servers to register their objects and assists client applications in the location of objects. The OSagent is designed to be operated on more than one node.This is done to avoid a single point of failure. OSagent processes follow a set of rules to discover each other and cooperate in the location of registered objects.

  • The client procedure calls the client stub in the normal way.
  • The client stub builds a message and traps to the kernel.
  • The kernel sends the message to the remote kernel.
  • The remote kernel gives the message to the server stub
  • The server stub unpacks the parameters and calls the server.
  • The server does the work and returns the result to the stub.
  • The server stub packs it in a message and traps to the kernel.
  • The remote kernel sends the message to the clients kernel.
  • The clients kernel gives the message to the client stub.
  • The stub unpacks the result and returns to the client.  

  • Assigning the security manager and then obtaining the reference to the service
  • Contacting the RMI registry to obtain the remote object’s reference and invoking its methods
  • Requesting the name for the service
  • Invoke the remote method.

The difference between unicast and multicast is that in unicast approach the sender sends the data stream to a single receiver at a time. Thus there is one to one communication.

In a multicast the sender and the interested receivers communicate. This is one to many communication. This communication can take place between data terminals spread across various LANs too.

The java.net.UnknownHostException method is used as remote calling and for callback routine fail. RMI uses default settings to resolve the server hostname like WINS names, DHCP names, etc. This happens due to which RMI client invokes the remote method using the reference that consists of unresolved server hostname and the client will produce UnknownHostException. RMI servers provide fully qualified hostname or IP address to resolve all RMI clients error reports. RMI provides an operation to remotely callback a program that serves RMI object and provide resolvable hostname to pass it to the RMI clients. UnkownHostException is thrown when an applet is failed to provide a useable server hostname. The property java.rmi.server.hostname can be set to get from the server the correct IP address or hostname.

In order to link this F2FInterview's page as Reference on your website or Blog, click on below text area and pres (CTRL-C) to copy the code in clipboard or right click then copy the following lines after that paste into your website or Blog.

Get Reference Link To This Page: (copy below code by (CTRL-C) and paste into your website or Blog)
HTML Rendering of above code: