Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

RMI%20Interview%20Questions%20and%20Answers

Question: Explain how URL convention is used for accessing the registry.
Answer: 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 ("//host:1111/RMIRegistry", 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://host/username/codebase/examples.ExampleRMIURL
Is it helpful? Yes No

Most helpful rated by users:

©2024 WithoutBook