aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes RMI via http, ftp or file protocol - how to implement? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "RMI via http, ftp or file protocol - how to implement?" Watch "RMI via http, ftp or file protocol - how to implement?" New topic
Author

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

Melinda White
Greenhorn

Joined: Jun 19, 2002
Posts: 25
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

Joined: Jan 30, 2002
Posts: 3451
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


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Melinda White
Greenhorn

Joined: Jun 19, 2002
Posts: 25
Thanks for the response - yes that helps.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: RMI via http, ftp or file protocol - how to implement?