Interview questions

RMI Registry service

RMI - What is Registry Service for RMI? - August 09, 2008 at 18:10 pm by Amit Satpute

What is Registry Service for RMI?
Explain how URL convention is used for accessing the registry.
Explain how to bind an object to the registry.

RMI Registry service - Jan 30, 2009 at 18:10 pm by Vidya Sagar

What is Registry Service for RMI?

The registration of the remote object must be done by the server in order for the client to look it up, is called the RMI Registry. In RMI, the client must contact an RMI registry, so that the server side application will be able to contact the client’s registry which points the client in the direction of the service. The client registers the service with the registry so that it is transparent to even for the server.

Explain how URL convention is used for accessing the registry.

The class rebind () method of java.rmi.Naming class is used to specify the port number . For example if the registry is running on a port number 3271 of an application named HelloRMIRegistry the following is the usage of the URL to reference the remote object:

Naming.rebind ("//myhost:3271/ HelloRMIRegistry ", obj);

The URL stored on the web page needs to specify the non-default port number.
When the server’s remote objects created by the server can include the URL from which the stub class can dynamically be downloaded to the client. The following example depicts this:

java -Djava.rmi.server.codebase=http://myhost/~username/codebase/

where ExampleRMIURL is the name of the application.

Explain how to bind an object to the registry.

If an object implements the java.rmi.Remote interface, an object is to be bound to registry context. Each registry context implements the Referenceable interface.

The object factory is implemented by the RegistryContextFactory which converts the registry references into the corresponding registry contexts or remote objects. To construct the registry constructs, the URL of the registry must be determined. In this way the remote objects will be bounded with registry contexts.


Write your comment - Share Knowledge and Experience

More RMI links
What are the layers of RMI Architecture?

Answer - The three layers are the Stub and Skeleton Layer, the Remote Reference Layer,..........

Explain the diffference between RMI registry and OSAgent.

Answer - RMI registry is the binder for Java RMI. An instance of RMI registry.........

Latest placement tests
Latest links
Latest MCQs
» General awareness - Banking » ASP.NET » PL/SQL » Mechanical Engineering
» IAS Prelims GS » Java » Programming Language » Electrical Engineering
» English » C++ » Software Engineering » Electronic Engineering
» Quantitative Aptitude » Oracle » English » Finance
Home | About us | Sitemap | Contact us