Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RMI via http, ftp or file protocol - how to implement?

 
Melinda White
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I read in the FAQ that RMI works via ftp, http, or a file protocol. I've seen references to a link here on this BB that contains an http server if we'd like to test it out. Also I've read that the client thread id can be different for each client request if using the http implementation of RMI. If I download the http server, how should I modify my code to use it? Anyone have any links to some sample code?
Now for a (probably) stupid question: I've implemented my client and server using a URL - it's not preceeded by "http" so what protocol is this using:
My apologies for the formatting of this code - I can't get it formatted oorrectly here!
Here is my client code: "host name" is either "localhost" or an ip address.
try
{
String remoteDataObject = "//" + hostName + "//idataAccess";

remoteDataAccess = (IDataAccessNetwork) Naming.lookup(remoteDataObject);
}
Also, some of my colleagues say that RMI is going away - it's not being used anymore. Some say it's slow. Anyone have any take on this? Will knowing RMI do me any good??? Does RMI marshall data in a way that is specific to Java only?
Thanks in advance,
Melinda
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Melinda,
Well, I'll take a crack at answering some of this.

... it's not preceeded by "http" so what protocol is this using:

rmi:// is the protocol.

Also, some of my colleagues say that RMI is going away - it's not being used anymore. Some say it's slow. Anyone have any take on this? Will knowing RMI do me any good??? Does RMI marshall data in a way that is specific to Java only?

To say that RMI is going away is probably overstating the problem. With the adoption of firewalls and NAT servers, RMI has become hard to work with but I think it's a bit early to start planning the funeral. Now the RMI transport is compatible with CORBA, making it possible, at least in theory, for RMI objects to communicate with CORBA objects. Of course distributed programming as we know it is probably on the decline because of the web, so who really knows?
Sun's implementation of RMI is not very robust, but I understand that there are others that have managed to greatly improve the performance. I think learning RMI will do you some good if you are a beginner or novice in distributed programming, if you're an expert probably not unless you're looking for a job as a Java developer for a company that uses RMI. My understanding is that the RMI-IIOP transport marshalls objects the same way CORBA does, so it is not Java specific.
Hope this helps,
Michael Morris
 
Melinda White
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the response - yes that helps.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic