41.Discuss in brief about Remote Method Invocation (RMI) and its working?RMI is a java object equivalent process that invokes a method in a distributed environment. 42.What is the difference between RMI and JMS?
43.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. 44.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 ("//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
45.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. 46.Explain the various methods of registering and gaining access to the Remote Object?
The methods of remote objects are to be invoked by implementing the java.rmi.Remote interface. 47.Explain the steps to create RMI-based clients and server?Creation of RMI-based Server: 48.What are Remote callbacks?In client-server technology / architecture, a server responds to a remote client. A call back is a method invocation from one application (Application A) from another application (Application B), as a result of action that was performed by the Application B earlier. The Application A may run on a client and the Application may run on a server. To perform the call back mechanism the system that Application A runs acts as a Server and that of the Application B runs acts as a client. 49.What is Object Activation?Object Activation is a process of providing persistent references to the objects. It also includes the managing the execution of implementing of objects. RMI activates the objects for the execution as and when needed. The appropriate execution is initiated inside the appropriate JVM when the activatable remote object is accessed which is not currently running. • 1
• 2 • 3 • 4 • 5 • 6 • 7 50.What is data transfer in RMI model?Data in a file can be transferred by using the method getFileContents(filename) in the remote interface. 51.What is object serialization in RMI?To marshal and unmarshall the parameters involves the object serialization and does not truncate types. 52.What is RMI callback mechanism?When one service passes an object which is the proxy for another service, the RMI callback mechanism occurs. The methods will be invoked by the recipient in the object it received and be calling back to the calling point. The stub contains the information that is needed to call back to server at the time of the need. 53.What is the role of Remote Interface in RMI?Remote interfaces are defined by extending ,an interface called Remote provided in the java.rmi package. The methods must throw RemoteException. But application specific exceptions may also be thrown. 54.Explain marshalling and demarshalling.During communication between two machines through RPC or RMI, parameters are packed into a message and then sent over the network. This packing of parameters into a message is called marshalling. 55.What is a skeleton in RMI?Server side stub is refered to as a skeleton. 56.Explain the role of stub in RMI.?The role of the stubs is to marshal and unmarshal the messages that are sent and received on the client or the server side. 57.What are the layers on which RMI implementation is built? Explain them.?
58.Explain how RMI clients contact remote RMI servers.
* 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. 59.What are the basic steps to write client-service application using RMI?
* 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. 60.What is Unicast and Multicast object?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. |