YouTube Icon

Interview Questions.

Top 100+ Remote Method Invocation Interview Questions And Answers - Jun 01, 2020

fluid

Top 100+ Remote Method Invocation Interview Questions And Answers

Question 1. What Is The Method That Is Used By The Rmi Client To Connect To Remote Rmi Servers?

Answer :

RMI is known as Remote technique invocation and to for the RMI customer to hook up with far flung RMI server first aspect is to get keep on a reference of the server.

The Naming.Lookup method is used to as a mechanism that is used to offer the way to acquire the references to remote servers. The far flung servers may be acquired by using the usage of the far off calls that return far flung references. This additionally makes use of a stub to make a far off method call used in rmiregistry that sends lower back to far flung reference.

Then the references includes a server hostname and port range, which permit clients to discover a digital gadget. This digital device is used to allow the faraway item to be found and connected. After the faraway reference are supplied to RMI client, then it is going to be easy to apply hostname and port this is supplied to open the socket connection to a faraway server.

Question 2. What Is The Function Of Java.Net.Unknownhostexception?

Answer :

The java.Net.UnknownHostException technique is used as faraway calling and for callback ordinary fail. RMI uses default settings to remedy the server hostname like WINS names, DHCP names, and so on. This takes place because of which RMI purchaser invokes the far off approach using the reference that includes unresolved server hostname and the consumer will produce UnknownHostException. RMI servers offer completely certified hostname or IP cope with to solve all RMI clients blunders reviews. RMI provides an operation to remotely callback a application that serves RMI item and provide resolvable hostname to pass it to the RMI customers. UnkownHostException is thrown whilst an applet is failed to offer a useable server hostname. The property java.Rmi.Server.Hostname may be set to get from the server the ideal IP address or hostname.

J2EE Interview Questions
Question 3. What Are The Reasons Of Getting Unknownhostexception Error Even If All The Setting Are Properly Configured?

Answer :

The UnkownHostException errors can come for plenty reasons. To discover first there is a want to realize the network's call provider that is having a completely-certified hostname diagnosed through RMI host. The feasible issues that would come are:

There is a possibility of getting misconfigured DHCP servers that permits fully-certified area call of RMI server machines. RMI patron in this situation attempt to get entry to the outside server's DHCP domain a good way to make it unavailable for the server.

There is a opportunity of getting the mistake because of WINS server. It is feasible that handiest registered users might not be on hand by using hosts.

There is a possibility of having a firewall this is blocking off the RMI client and server aspect requests. If the server resides inside the firewall and the patron outside then the customer might not be capable of make any faraway calls to the server this is inner due to the firewall.

Question four. What Is The Use Of Http-tunneling In Rmi?

Answer :

HTTP-Tunneling is a technique that calls for no setup and works within the firewall surroundings. It allows the coping with of HTTP through proxy server and doesn't permit ordinary outbound TCP connections. If the RMI fails to make any connection in particular SOCKS then connection is made via an supposed server that permit the HTTP proxy server to be configured. This will allow the request to be exceeded via the proxy server one at a time.

The varieties of HTTP-tunneling are http-to-port: where the RMI try to use HTTP POST request the use of a URL that will be directed on the hostname and port wide variety of the server that is given. If the proxy accepts the URL it'll forward a POST request to pay attention to RMI server with the intention to cast off the request of the name. There is an http-to-cgi tunneling with a view to consists of the requests and permit the proxy request to be binded to their described port numbers.

J2EE Tutorial
Question 5. How Does Distributed Garbage Collection Manages The Disconnections Detected On The Client Side?

Answer :

RMI uses a runtime patron that a virtual system detects of the remote object that is not referenced regionally. It notify the server in got here of any disconnections and this way the server may be updated by using the item's set. The garbage collector that is distributed partner an cope with with every consumer faraway object reference.

It also renew the remote items while the consumer nevertheless includes the references. This mechanism will allow the atypical termination of the customers in order that server can preserve the faraway gadgets that aren't referenced the use of the message that are stopped going for walks. The function System.Go out() may be invoked for unusual termination, as it would not allow the RMI runtime to send a right messages to the server. This characteristic will terminate the patron digital device and could maintain the far flung references so that it will be wiped clean up earlier than exiting.

The different features which are used for this are:

System.Gc();
System.RunFinalization();
Core Java Interview Questions
Question 6. What Is The Relationship Between The Rmi And Corba?

Answer :

RMI is a allotted object machine that provides and enable to without problems broaden the dispensed Java programs. It is easier to develop programs the usage of the RMI technique then the usage of the sockets. It does not require any protocol for design that makes it less susceptible to mistakes for the responsibilities done by way of it. RMI is allows the local technique to be known as from a neighborhood magnificence report and the faraway strategies are interpreted and are sent lower back to the callers.

The CORBA additionally having the equal capabilities which might be visible in RMI. It is a platform and language independent structure that may be run on any platform. It may be positioned from everywhere on the community and can be utilized in any language that has a mapping with IDL (Interface definition language). The gadgets of this are distinct with interfaces that are detailed within the interface language.

Question 7. What Are The Different Terms That Are Used In Rmi?

Answer :

There are one of a kind terms which are used in RMI that allows in calling the faraway servers and allow an smooth to use terminology to be created:

Remote object: It is an object this is provided on any other computer to request the item via sending a message to the object to the remote servers.
Server item: It is an object of the server side that get hold of the request and respond to the request of the consumer in achievement or failure.
Rmiregistry: It is the registry that keeps the look united statesof all of the gadgets in a list by using given name. This registry is composed the list of all of the additives that are given in it.
Rmic: It is a compiler for RMI item.
After creating the item the compiler compiles the item and it'll generate the actual code this is to be transferred to the purchaser side.

Core Java Tutorial JDBC Interview Questions
Question eight. What Are The Different Types Of Classes That Are Used In Rmi?

Answer :

The training define the blueprint that consists of the methods and conduct of a selected shape.

The training are:

Remote class: It is the class that includes the times that can be accessed remotely from the server and also is composed of different properties which can be required to be accessed through the purchaser and server throughout request and reaction time.

Remote elegance item: Wherever this object is defined the instances of the elegance can be accessed the usage of different item. On different computers that are not in network it could be accessed thru using item handles.

Serializable elegance: It is the class that includes times that can be marshaled or became in a linear series to symbolize the bits.

Serializable magnificence gadgets: It allows the request to be transmitted from one laptop to any other. It lets in the clean implementation of the serializable magnificence.

Question nine. What Are The Different Conditions That Has To Be Kept In Mind When Using Serialization Concept?

Answer :

The situations that needs to be kept in mind even as using serialization is that: 

The magnificence ought to be declared as public and it must implement the serializable version identifier this is given as serialVersionUID to read the serial versions which might be being loaded or updated. 

The magnificence must not includes any argument constructor and all of the fields of the elegance should have a serializable field in it. This can be both primitive sorts or Serializable gadgets type. 

The magnificence would not itself declare any methods and an execption can be made inside the fields which might be made brief and these are unnoticed at some point of serialization.

Powerbuilder Programmer Interview Questions
Question 10. What Is The Process Of Making A Class Serializable?

Answer :

To create a class serializable there's mechanism of serializing an object at the customer code. 

There are four things which are required to make a category serializable and those are: 

The first factor that must be accomplished is to implement the serializable interface that makes the manner clean to convert the set of object references to the linear circulate of bytes.
Check whether the instance degree that is locally defined country is in serialized mode or not. Check that it has been applied well or now not.
Check whether the superclass nation inside the serialized phase is nicely controlled and altered. If it's miles adjusted then with the assist of few function the system can create a category serializable.
Then use the strategies like equals( ) and hashCode( ) to override the already used features. This will allow the addition of latest code to be inserted
JDBC Tutorial
Question eleven. What Is The Procedure Of Implementation Of The Serializable Interface?

Answer :

The implementation is the clean section of the serializable magnificence. At first this interface remains as an empty interface and it announces no techniques or behavior in any respect. It has additing function that is delivered to the implements serializable magnificence to comply with the class declarations. It is not required to make every object as serializable as there may also be a few training that won't be having any serialization required. 

For instance, an instance of a record that simply represents a document gets created by way of the usage of File file = new File("c:careerride");

so that you could make this work there may be no surity this is it require a serialized code to be written. The document magnificence is having a one of a kind lifecyle than the serialized facts and amendment in it'd take away the entire facts. There also are platform dependencies that entails native code not used for serialization.

EJB(Enterprise JavaBeans) Interview Questions
Question 12. What Is The Main Purpose Of Distributed Object Applications In Rmi?

Answer :

RMI consists of a server and a customer program. The utility in RMI creates some of remote items that makes the references to the items which are to be available. This manner whilst a patron makes a name to the approach on remote objects then the reference is passed to 1 or extra remote items in server.

It then invokes sure techniques on them to offer few functionalities. RMI provides the mechanism to speak and skip the data from one component to another using the disbursed item applications. It requires to discover the faraway gadgets so that the registry may be maintained for the faraway items with RMI's naming facility, rmiregistry, and the software which could pass the faraway object references and return it as a ordinary operation.

J2EE Interview Questions
Question thirteen. How Does The Communication With Remote Objects Occur In Rmi?

Answer :

RMI handles the remote items which can be being provided between the server and client computers. The difference between the items are dealt with the usage of RMI as properly. RMI uses the standard approach invocation to speak among one item or some other item. It loads the elegance byte-codes for objects which might be surpassed using the described parameters and go back the values to the server in case of failure or success of it. RMI also allows the transmission to be carried out when passing the data as nicely.

The string this is utilized by the RMI registry is “rmi://hostname:port/remoteObjectName", this allows the RMI registry to recognize the precise object and create a connection between unique objects via this. If the hostname isn't defined then local host can be used rather than it and this could also establish the connection

EJB(Enterprise JavaBeans) Tutorial
Question 14. What Are The Steps That Are Involved In Rmi Distributed Applications?

Answer :

RMI dispensed applications uses sure steps that defines the route cited inside the registry. It has the following steps:

It makes use of the registry that shops the area and essential facts about the faraway object.
It makes use of the registry to acquire the references to a faraway object that maintains all the data and permit in addition communication to be achieved.
The server calls the registry to companion the call with the far off item and then the consumer sends the request for the item.
The consumer searches the far off object by way of its name within the registry on the server and invokes a technique on it.
RMI uses a web server to load the bytecodes of instructions to use the communique for the customer and server.
RMI can load the class using the Internet protocols like HTTP, FTP, document, and and many others.
Question 15. What Is The Use Of Java.Rmi.Remote Interface In Rmi?

Answer :

RMI uses a remote interface maintaining the techniques which might be invoked from a digital machine and similarly forwarded to the server to take any request coming from the patron.

Java.Rmi.Remote provides an interface asserting a set of methods that invokes the virtual machine to fulfill the requirements.

This lets in the extension of the interface without delay or circuitously.

Each approach announcement in far flung interface ought to have the exception policy consisting of java.Rmi.RemoteException or java.Io.IOException or java.Lang.Exception clause that may be made utility precise and it reduces the effort to extend java.Rmi.RemoteException.

Remote approach publicizes the object as a parameter or the go back value and that must be declared using the far off interface

MYSQL DBA Interview Questions
Question sixteen. Write A Program To Show The Remote Interface Using Rmi?

Answer :

Remote interface permits the extension of the interface of java.Rmi.Remtoe.

This interface extends it non-remotely the use of the circumstance that this make bigger the interface whilst all the methods used also are extended within the interface that satisfy all the necessities of a far off technique assertion.

The example code indicates the far off interface this is used in general:

public interface Bank extends java.Rmi.Remote

public void deposit(waft amount)
throws java.Rmi.RemoteException;
public void withdraw(drift quantity)
throws OverdrawnException, java.Rmi.RemoteException;
public go with the flow getBalance()
throws java.Rmi.RemoteException;


The magnificence of this extends the java.Rmi.Remote to inherit the conduct and properties utilized by this distinct class.This also makes use of several different elegance gadgets for example:

java.Rmi.Server.RemoteObject and java.Rmi.Server.RemoteServer.

Maven Tutorial
Question 17. Write A Program To Show The Distributed Object Model Using Rmi?

Answer :

To put in force the dispensed item model a class is required that implements a remote interface extending the functionality of java.Rmi.Remote and other training such as java.Rmi.Server.UnicastRemoteObject.

The implementation then take the obligation for exporting the item having the right use of far off semantics provided using hashCode, equals, and toString techniques which can be inherited from the java.Lang.Object elegance.

The code is given underneath as:

public void withdraw(glide amount) throws OverdrawnException,
RemoteException
// write your own statements

public float getBalance() throws RemoteException

// write your very own statements


Java applet Interview Questions
Question 18. Why Are Stubs Used In Rmi?

Answer :

RMI makes use of a mechanism this is standard for all of the machine and it's miles used to talk with all the remote objects that are to be had. So, stubs are used to store the gadgets in the database so that it could be used in a while. A stub is used for remote items that act as a consumer’s neighborhood proxy for the remote item. This manner the caller of the item calls the method at the local stub that will become responsible to perform the method name on the far flung items.

RMI makes use of stub for a far flung object that implements the identical set of faraway interfaces that is applied by using far off item. The stub is used to provoke the connection between the object and the java virtual machine. It marshalls that consists of write and transmit the parameters to the remote java virtual gadget that consists of the approach invocation. It lets in the unmarshalling of the item to go back the real price or the exception to be lower back to the caller. The stub is used to cover the serialization of the parameter at network-stage for the communique to be proceeded with none disturbance.

Core Java Interview Questions
Question 19. Why Is The Function Or Role Of Skeleton In Rmi?

Answer :

Every object that can be remotely accessed have a corresponding skeleton that functions like the unique object. It is answerable for dispatching the decision that is made to the actual faraway item for the implementation and allow it to be carried out the usage of the offerings provided with the aid of RMI. It lets in the incoming method invocation to unmarshals i.E. Only study the parameters used for the far off method. It invokes the technique that is utilized by the real remote item and after implementation marshals the result to the caller who's the authentic caller for the object.

JavaMail API Tutorial
Question 20. How Does Dynamic Class Loading Happens In Rmi?

Answer :

RMI makes use of unique parameters with values and exceptions and they all has to be handed for RMI calls. It creates the item that is serializable.

RMI uses the serialization mechanisms to transfer the facts from one gadget to any other the use of the virtualization idea. This is done in order that the caller can acquire the documents on time. When the parameters go back the values of the method invocation and unmarshals it then the live objects receives acquired with the aid of the java digital machines.

The unmarshalling procedure tries to resolve the call issue of the lessons by loading the context magnificence the use of the cutting-edge thread. RMI offers the dynamic loading of the magnificence definition to be finished using actual styles of items which can be surpassed as parameters and go back values for RMI.

This permits the dynamic loading of the far off stub lessons which are related to a particular remote object that takes element in implementation of the lessons.

RMI also uses special subclasses of java.Io.ObjectOutputStream and java.Io.ObjectInputStream for marshilling and unmarshalling.

Maven Interview Questions
Question 21. What Is The Difference Between Url Instance And Urlconnection Instance?

Answer :

A URL example represents the location of a useful resource, and a URLConnection instance represents a hyperlink for gaining access to or speaking with the useful resource at the region.

Question 22. How Do I Make A Connection To Url?

Answer :

You gain a URL instance after which invoke openConnection on it. URLConnection is an summary elegance, this means that you may’t directly create times of it using a constructor. We need to invoke openConnection technique on a URL instance, to get the right type of connection in your URL. Eg. URL url;

URLConnection connection;
strive 
url = new URL(”…”);
connection = url.OpenConnection();
 catch (MalFormedURLException e)  

Spring MVC Framework Tutorial
Question 23. What Is A Socket In Java Networking And Rmi?

Answer :

A socket is one give up-factor of a two-way communication hyperlink among  applications going for walks at the network. A socket is bound to a port wide variety so that the TCP layer can become aware of the application that statistics is destined to be despatched. Socket instructions are used to symbolize the relationship among a customer software and a server application. The java.Internet package deal affords two classes–Socket and ServerSocket–which enforce the purchaser facet of the connection and the server side of the connection, respectively.

JavaMail API Interview Questions
Question 24. What Information Is Needed To Create A Tcp Socket?

Answer :

The Local System's IP Address and Port Number. And the Remote System’s IPAddress and Port Number.

JDBC Interview Questions
Question 25. What Are The Two Important Tcp Socket Classes?

Answer :

Socket and ServerSocket. ServerSocket is used for ordinary -way socket communication. Socket magnificence permits us to examine and write via the sockets. GetInputStream() and getOutputStream() are the two techniques to be had in Socket elegance.

AWT (Abstract Window Toolkit) Tutorial
Question 26. When Malformedurlexception And Unknownhostexception Throws?

Answer :

When the specified URL is not connected then the URL throw MalformedURLException and If InetAddress? Methods getByName and getLocalHost are unable to clear up the host call they throw an UnknownHostException.

JNDI (Java Naming and Directory Interface) Interview Questions
Question 27. What Does Rmi Stand For?

Answer :

It stands for Remote Method Invocation.

Powerbuilder Programmer Interview Questions
Question 28. What Is Rmi?

Answer :

RMI is a fixed of APIs that permits to construct dispensed programs. RMI uses interfaces to define far off objects to turn neighborhood method invocations into far off approach invocations.

Question 29. What Is The Difference Between The File And Randomaccessfile Classes?

Answer :

The File class encapsulates the files and directories of the neighborhood document device. The RandomAccessFile elegance gives the methods needed to immediately get right of entry to data contained in any part of a record.

Corba Interview Questions
Question 30. What Interface Must An Object Implement Before It Can Be Written To A Stream As An Object?

Answer :

An item must implement the Serializable or Externalizable interface before it is able to be written to a circulation as an object.

Question 31. Explain Rmi Architecture?

Answer :

RMI uses a layered structure, each of the layers might be better or replaced without affecting the relaxation of the gadget. The information of layers can be summarised as follows:

Application Layer: The consumer and server application
Stub & Skeleton Layer: Intercepts approach calls made by means of the patron/redirects these calls to a far flung RMI carrier.
Remote Reference Layer: Understands how to interpret and manipulate references crafted from clients to the remote provider objects.
Transport layer: Based on TCP/IP connections among machines in a network. It offers basic connectivity, in addition to some firewall penetration strategies.
Question 32. What Is The Difference Between Rmi & Corba?

Answer :

The most tremendous distinction between RMI and CORBA is that CORBA turned into made particularly for interoperability throughout programming languages. That is CORBA fosters the perception that programs may be built to have interaction in multiple languages. The server will be written in C++, the business good judgment in Python, and the front-cease written in COBOL in principle. RMI, however is a total Java solution, the interfaces, the implementations and the customers--all are written in Java.

RMI lets in dynamic loading of classes at runtime. In a multi-language CORBA environment, dynamic magnificence loading isn't always possible. The important advantage to dynamic elegance loading is that it allows arguments to be passed in far flung invocations which can be subtypes of the declared kinds. In CORBA, every kind need to be acknowledged in advance. RMI (as well as RMI/IIOP) affords aid for polymorphic parameter passing, whereas strict CORBA does no longer. CORBA does have support for multiple languages which is good for some packages, but RMI has the advantage of being dynamic, which is ideal for different applications.

Spring MVC Framework Interview Questions
Question 33. What Are The Services In Rmi ?

Answer :

An RMI "provider" could well be any Java method that may be invoked remotely. The different service is the JRMP RMI naming carrier that's a research carrier.

EJB(Enterprise JavaBeans) Interview Questions
Question 34. How Many Types Of Protocol Implementations Does Rmi Have?

Answer :

RMI has as a minimum three protocol implementations: Java Remote Method Protocol(JRMP), Internet Inter ORB Protocol(IIOP), and Jini Extensible Remote Invocation(JERI). These are options, now not a part of the equal thing, All 3 are indeed layer 6 protocols for folks who are nevertheless talking OSI reference version.

Question 35. Does Rmi-iiop Support Dynamic Downloading Of Classes?

Answer :

RMI-IIOP does not help dynamic downloading of the training as it is achieved with CORBA in DII (Dynamic Interface Invocation).Actually RMI-IIOP combines the usability of Java Remote Method Invocation (RMI) with the interoperability of the Internet Inter-ORB Protocol (IIOP).So with the intention to acquire this interoperability between RMI and CORBA,a number of the capabilities that are supported by using RMI however not CORBA and vice versa are removed from the RMI-IIOP specification.

Question 36. Can Rmi And Corba Based Applications Interact ?

Answer :

Yes they could. RMI is to be had with IIOP as the delivery protocol in preference to JRMP.

MYSQL DBA Interview Questions
Question 37. What Is Remote Procedure Calls, Rpc?

Answer :

A request from one application that is placed in one computer may be utilized by another laptop in a community environment with out information the underlying network information. This is done by means of a protocol referred to as Remote Procedure Calls. In this purchaser / server environment (network surroundings), the request is from a purchaser to the server that provides the service from a server.

RPC is also called as inter-process communication. RPC extends the everyday manner calls throughout the network that's necessary in disbursed computing fashions and for harnessing the strength of the a couple of processors.

In allotted systems, a customer calls a method stored on a server. This is known as calling a remote process saved on a server. Though, the call is made as if the method was stored on the nearby device.

The steps wherein a RPC is made are:

The purchaser calls the manner
The client stub builds the message.
The message is despatched over the community.
The Server OS offers the message to the server stub.
The server stub unpacks the message.
The stub makes a nearby call to the manner.
The server does the paintings and returns the end result to the server stub.
The stub packs the message and traps to the kernel.
The far off kernel sends the message the client kernel.
The customer kernel offers the message to the patron stub.
The client stub unpacks the end result and gives to the consumer.
Question 38. Explain The Advantages And Disadvantages Of Rpc?

Answer :

Advantages of RPC:

Server independent
Process-orientated and thread oriented models supported via RPC
The improvement of allotted structures is easy because it uses truthful semantics and less complicated.
Like the commonplace communications among the portions of an utility, the development of the approaches for the faraway calls is quite widespread.
The procedure calls preserves the business logics which is apt for the software.
The code re-writing / re-developing effort is minimized.
Enables the use of the packages used inside the allotted environment, not simplest in the nearby surroundings.
RPC affords interoperability between CORBA ORB implementations.
A light-weight RPC protocol lets in efficient implementations.
Disadvantages of RPC:

Context switching will increase scheduling fees
RPC isn't a trendy – it's miles an concept that can be applied in lots of ways
RPC does no longer solve the most of the distribution creation troubles
RPC is best interplay based. This does not provide any flexibility in phrases of hardware architecture.
RPC implementations are not but mature.
It calls for the TCP/IP protocol. Other transport protocols are not supported yet.
Not but confirmed over huge-region networks.
Question 39. Explain The Difference Between Rpc And Rmi?

Answer :

RMI 

The far off gadgets are accessed with the aid of the references.
Implements item to object implementation among one of a kind java items to implement dispensed communique version.
RMI passes the objects as parameters to remote strategies.
RMI invokes the faraway strategies from the items.
RPC :

The system is thru strategies / functions.
Proxy server is worried in processing the technique calls.
Calls a technique remotely like invoking the strategies.
The remoteness is not exactly transparent to the patron.
Question forty. What Is Unicast And Multicast Object?

Answer :

The difference among unicast and multicast is that in unicast method the sender sends the information circulation to a unmarried receiver at a time. Thus there's one to at least one verbal exchange.

In a multicast the sender and the involved receivers talk. This is one to many communique. This conversation can take location between facts terminals spread across numerous LANs too.

Java applet Interview Questions
Question 41. What Are The Basic Steps To Write Client-service Application Using Rmi?

Answer :

Assigning the safety supervisor after which obtaining the reference to the provider
Contacting the RMI registry to achieve the faraway object’s reference and invoking its strategies
Requesting the call for the service
Invoke the remote approach.
Question forty two. Explain How Rmi Clients Contact Remote Rmi Servers?

Answer :

The client method calls the consumer stub in the everyday manner.
The customer stub builds a message and traps to the kernel.
The kernel sends the message to the faraway kernel.
The remote kernel offers the message to the server stub.
The server stub unpacks the parameters and calls the server.
The server does the paintings and returns the end result to the stub.
The server stub packs it in a message and traps to the kernel.
The far off kernel sends the message to the clients kernel.
The clients kernel offers the message to the patron stub.
The stub unpacks the end result and returns to the purchaser.
Maven Interview Questions
Question forty three. What Are The Layers On Which Rmi Implementation Is Built? Explain Them.?

Answer :

The Stub/Skeleton Layer: The stub/skeleton layer sits in between application layer and the rest of the RMI gadget and acts as an interface. This layer transmits the records to remote layer. This transmission is accomplished through the marshalling of streams. These streams plays the item serialization.A stub is a faraway item on the customer-aspect. This stub implements all of the interfaces which faraway item implementation supports.A skeleton is a far flung item on the server-side. This stub includes methods that invokes dispatch calls to the faraway implementation of items.

The Remote Reference Layer: The lower level delivery interfaces is dealt with the aid of this accretion. This layer carries a particular far flung reference protocol independent of stub and skeletons.Every faraway object is implemented through selecting their person faraway reference subclasses.

The Transport Layer: The shipping layer sets up the connections to far flung address spaces, manages them, monitors the relationship liveliness, and listens the incoming calls.

The shipping layer keeps the far off object’s table to be had within the deal with space, in a table. For incoming calls, the shipping layer establishes a connection. It locates the goal dispatcher of the far flung calls and passes the connection to the dispatcher.

Question 44. Explain The Role Of Stub In Rmi.?

Answer :

The role of the stubs is to marshal and unmarshal the messages that are sent and acquired at the consumer or the server aspect.

Question 45. What Is A Skeleton In Rmi?

Answer :

Server side stub is referred to as a skeleton.

Question forty six. Explain Marshalling And Demarshalling?

Answer :

During communication among  machines through RPC or RMI, parameters are packed right into a message and then despatched over the community. This packing of parameters right into a message is referred to as marshalling.

On the opposite facet those packed parameters are unpacked from the message that's called unmarshalling.

Question 47. What Is The Role Of Remote Interface In Rmi?

Answer :

Remote interfaces are defined with the aid of extending ,an interface referred to as Remote provided in the java.Rmi package. The methods have to throw RemoteException. But software precise exceptions may also be thrown.

Question 48. What Is Rmi Callback Mechanism?

Answer :

When one carrier passes an object that's the proxy for any other service, the RMI callback mechanism takes place. The strategies can be invoked by using the recipient inside the item it acquired and be calling back to the calling point. The stub includes the records this is wished to call returned to server at the time of the need.

Question 49. What Is Object Serialization In Rmi?

Answer :

To marshal and unmarshall the parameters involves the item serialization and does not truncate sorts.

The methods of local item and their bytecodes aren't surpassed directly within the ObjectOutputStream. At instances the name of the magnificence of the items may be wanted that is to be loaded via the receiver if at all the class isn't to be had domestically. Just like the names of the classes, the elegance documents themselves will no longer be serialized. All classes have to load for the duration of the manner of deserialization the use of the normal mechanisms of sophistication loading.

Question 50. What Is Data Transfer In Rmi Model?

Answer :

Data in a document may be transferred with the aid of using the method getFileContents(filename) inside the faraway interface.

RMI supports to transfer statistics that is to be had in JDOM information gadgets.

Question 51. What Are Remote Callbacks?

Answer :

In customer-server generation / architecture, a server responds to a faraway patron. A name returned is a technique invocation from one utility (Application A) from any other application (Application B), due to movement that become accomplished by using the Application B in advance. The Application A may additionally run on a consumer and the Application may run on a server. To perform the call again mechanism the device that Application A runs acts as a Server and that of the Application B runs acts as a purchaser.

Question fifty two. Explain The Steps To Create Rmi-based Clients And Server?

Answer :

Creation of RMI-primarily based Server:

Create the Servant interface and the Servant aspect elegance
To host those servant classes create the RMI Server
Compile the magnificence documents and generate the Skeletons and IDL File
Start up the Server
Creation of RMI-primarily based Client:

Create the Client class
Copy the IIOP Stubs and collect the Client
Make certain the Server is going for walks after which startup the Client
Question 53. Explain The Various Methods Of Registering And Gaining Access To The Remote Object?

Answer :

The methods of faraway gadgets are to be invoked by using enforcing the java.Rmi.Remote interface.

Methods:

bind(): binds the required name to the far flung object. The name parameter of this approach have to be in an URL layout.
Unbind(): Destroys the binding for a specific name of a far flung technique within the registry
rebind(): Binds again the required call to the far flung object. The current binding will be replaced by means of rebinding.
List(): Returns the names of the names that have been certain to the registry in an array shape. These names are within the form of URL-formatted string.
Research(): A stub, a reference can be returned for the far flung object that's associated with a certain call.
Question fifty four. Explain How To Bind An Object To The Registry.?

Answer :

If an item implements the java.Rmi.Remote interface, an item is to be certain to registry context. Each registry context implements the Referenceable interface.

The item manufacturing unit is applied with the aid of the RegistryContextFactory which converts the registry references into the corresponding registry contexts or far flung objects. To assemble the registry constructs, the URL of the registry must be decided. In this way the far off objects might be bounded with registry contexts.

Question fifty five. What Is Registry Service For Rmi?

Answer :

The registration of the faraway item need to be completed by the server so as for the client to appearance it up, is referred to as the RMI Registry. In RMI, the client must contact an RMI registry, so that the server aspect utility will be capable of contact the customer’s registry which points the client in the course of the carrier. The patron registers the carrier with the registry in order that it is obvious to even for the server.




CFG