On Wed, 24 Oct 2001 22:11, Jeremias Maerki wrote: > Hi > > For my server app I have a custom URL protocol handler that needs to be > registered. Normally this is done by setting the > -Djava.protocol.handler.pkgs parameter of the VM. But since my handler > needs several jars (such as application specific jars and other api jars) > I need to copy them into phoenix's lib directory to get it to work > (classloaders and all...). And I don't want to do that, of course.
yep - theres a few ugly things like that. The same also occurs with JNDI aswell ;( > So I wonder if the following is a good approach: Extend Phoenix to have > a special URL protocol facility where applications can register and > deregister their protocol handlers. Phoenix registers a special > URLProtocolHandlerFactory using URL.setURLProtocolHandlerFactory. > > I don't know in detail, yet, how I would implement it. Maybe if this is > a good idea, someone can give me a hint on how exactly to do it. Or > maybe there is a better way of doing it. Actually thats almost exactly how I handled the JNDI case. In this case it would look something like public class DefaultURLStreamHandlerFactory implements URLStreamHandlerFactory { private URLStreamHandlerFactory[] m_factorys; public void addFactory( URLStreamHandlerFactory m_factory ) { ... } public URLStreamHandler createURLStreamHandler( String protocol ) { for( int i = 0; i < m_factorys.length; i++ ) { final URLStreamHandler handler = m_factorys[i].createURLStreamHandler(protocol); if( null != handler ) return handler; } return null; } } I am not sure what is the best way at the moment. In the short term I would still chuck the jars in phoenix/lib if at all possible but the above could possibly be a long term solution depending on where we go. Alternatively is it possible to get the code that uses new URLs to directly use your handler factory (ie pass it into classloader or something?). -- Cheers, Pete ----------------------------------------------------------- If your life passes before your eyes when you die, does that include the part where your life passes before your eyes? ----------------------------------------------------------- --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]