Archived

This topic is now archived and is closed to further replies.

misterX

[java] RMIregistry

Recommended Posts

well, i''ve done a simple chat system on my computer using RMI. Until there, no problem. But i''ve 2 big questions: -what exactly is the role of ''UnicastRemoteObject''? (It doesn''t work if my chatter class doesn''t extend it, but i don''t understand why) -how to launch the RMIregistry on a distant server (on the web)? and how to maintain it running? how to see when it has crashed, and how to relaunch it automatically? Or is there a simplier possibility of using RMI without the registry? how?

Share this post


Link to post
Share on other sites
Last question first: No you cannot do RMI with using the rmiregistry.

Extending UnicastRemoteObject specifies that the object lives on the server. When the server returns an object the object is serialized, sent to the client, and then rebuilt. If the object extends UnicastRemoteObject however, the object is not serialized and sent to the client, instead an object-identifier is sent to client.

In essence, every class that does stuff on the server need to extend UnicastRemoteObject.



-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GED d- s:+ a- C++$ UL++ P++ L++ E W+ N+ o K? w !O M--(+) V-- PS+
PE Y+ PGP t-- 5++ X+ R(+) rv+(++) b+++ DI+ D(+) G e+>++ h r--> y+
----- END GEEK CODE BLOCK-----
geekcode.com

Share this post


Link to post
Share on other sites