Sunday, December 23, 2001 10:59 AM
You can't do it using pure RMI callbacks in the general case of multiple firewalls. That's reasonably certain. The only thing the Sun reference implementation provides for passing through firewalls is HTTP tunnelling and SOCKS. SOCKS will solve only a miniscule number of cases since it only helps on some client firewalls -- not the server firewall, and not all client firewalls.
HTTP tunnelling (the most useful solution) in RMI does not do callbacks. Therefore, once and for all, you can't do callbacks through firewalls to clients (in my opinion).
However you can do asynhronous communication from server to client through firewalls.
You can achieve asynchronous communication using an HTTP streaming socket from the client to a servlet on the server. This is well documented in the latest O'Reilly Java Servlets book and probably on the Web too.
You can also use JMS if your JMS provider handles HTTP tunnelling. This provides a heavier client, though.
WebLogic (alone as far as I know) provides transparent RMI callbacks in their implementation of RMI. The WebLogic runtime (as in the JMS case above) adds a lot of weight to your client, though. You can mitigate this by caching the applet using the Java Plug-In or by using WebStart.
The new RMI book called "java.rmi" speculates that Java 1.4 may solve the problem. I'm not holding my breath because I haven't seen this in black and white from Sun yet.