开发者

Java RMI - client to server call

Trying to get an understanding on how the RMI is working (I开发者_StackOverflow中文版 have a simple application that uses RMI and seems to work just fine).

My question is : What happens when an rmi call is made? What happens on the way from an rmi client to an rmi server?


after the lookup described above, the objects used as parameters in a rmi call are serialized (Marshalling) that means a byte by byte representation of the objects non transient data will be send over the network connection. On server-side the serialized data will be unmarshalled and the objects will be instantiated. After that the server-side method is invoked, return values will be returned in a similar way as parameters have been previously send. It is similar to writing an object into a file.

http://java.sun.com/j2se/1.4.2/docs/guide/rmi/faq.html


RMI is the object oriented approach for RPC.

There is a Stub in client side and a Skeleton in server side. Client and Server does not directly communicate but they communicate over Stub and Skeleton which are generated automatically..

As you might guess there must be some objects both Server and Client have to use. These objects are defined in Server side and hold in RMI Registry. Both server and client can call RMI registry and it works as a memory somehow (It is not a Memory this is an example just to be clear). Server binds an object to registry and client invokes methods on it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜