Overriding URL used by RMIHttpToCGISocketFactory

"Poulin, Maxime" <[email protected]> Tue, 7 Feb 2006 11:43:01 -0500
Newsgroups gmane.comp.java.sun.rmi
Message-ID <D58A761F4EB1C44785DEB7DD2661C0C7012F2042@TOR-MSG-01.cgiclients.com>
Hi all !

I am currently playing around the RMIHttpToCGISocketFactory solution for
our RMI application. I am using tomcat 5.5 for the ServletHandler (to
rout RMI calls to my RMI server). The webapp's web.xml file redirects
the "/cgi-bin/java-rmi.cgi" to my servlet.

Now, the problem I have is that this "/cgi-bin/java-rmi.cgi" is
hardcoded in the RMIHttpToCGISocketFactory. I would like to override the
method that returns the Socket, "createSocket(String, int)" : 
===
public Socket createSocket(String s, int i) throws IOException {
        return new HttpSendSocket(s, i, new URL("http", s, (new
StringBuilder()).append("/cgi-bin/java-rmi.cgi?forward=").append(i).toSt
ring()));
}
===
The problem I have is that the HttpSendSocket class used by this method
is a package-scope class (sun.rmi.transport.proxy) so I cannot override
the method in my own SocketFactory. 

The problem it causes me is that I am not able to put my ServletHandler
enywhere but in the ROOT webapp of tomcat.

All I want is to change the "/cgi-bin/java-rmi.cgi" in the method for
something else.

So far, the only solution I got was to copy all the classes from this
package in my own package so I can create my own factory.

Did anyone ran into this ?

===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff RMI-USERS".  For general help, send email to
[email protected] and include in the body of the message "help".

For a list of frequently asked RMI questions please refer to:
http://java.sun.com/j2se/1.3/docs/guide/rmi/faq.html

To view past RMI-USERS postings, please see:
http://archives.java.sun.com/archives/rmi-users.html