A
Abhijat Vatsyayan
Hi ,
I have an application (part of it is an RMI server) deployed on JBOSS
3.2.5 as a JMX service. I need my application to use my custom
URLStreamHandler for "file" protocol. I have tried two things -
* invoke URL.setURLStreamHandlerFactory( ... ) with my custom factory.
This throws an Error. JBOSS is setting up a factory before my code gets
a chance to do this (does make some sense).
* I moved my handler (subclass of URLStreamHandler) to "x.y.z.url.file"
package and renamed the handler class to "Handler" . After this I set
the system property "java.protocol.handler.pkgs" to "x.y.z.url" . This
does not seem to work as well in JBoss. I tried this in a simple
application and looks like I can not use my custom handler for "file"
protocol (without setting a factory). It works if I change the protocol
name (and package name) to "tile" (or some other unknown protocol)
instead of "file".
So here is the problem - if someone has already set the
URLStreamHandlerFactory, how do I use my custom URLStreamHandler for
"file" protocol ?
Thanks,
Abhijat
|*
*||*
<../../java/net/URL.html#setURLStreamHandlerFactory%28java.net.URLStreamHandlerFactory%29>*|
I have an application (part of it is an RMI server) deployed on JBOSS
3.2.5 as a JMX service. I need my application to use my custom
URLStreamHandler for "file" protocol. I have tried two things -
* invoke URL.setURLStreamHandlerFactory( ... ) with my custom factory.
This throws an Error. JBOSS is setting up a factory before my code gets
a chance to do this (does make some sense).
* I moved my handler (subclass of URLStreamHandler) to "x.y.z.url.file"
package and renamed the handler class to "Handler" . After this I set
the system property "java.protocol.handler.pkgs" to "x.y.z.url" . This
does not seem to work as well in JBoss. I tried this in a simple
application and looks like I can not use my custom handler for "file"
protocol (without setting a factory). It works if I change the protocol
name (and package name) to "tile" (or some other unknown protocol)
instead of "file".
So here is the problem - if someone has already set the
URLStreamHandlerFactory, how do I use my custom URLStreamHandler for
"file" protocol ?
Thanks,
Abhijat
|*
*||*
<../../java/net/URL.html#setURLStreamHandlerFactory%28java.net.URLStreamHandlerFactory%29>*|