Stephen McConnell wrote:
What about the
Based on some problems occuring with URL handler registration (see recent comments from Richard Wallace on avalon-users) I've been looking at moving the URL handling in Merlin to use the sourceresolve package.
However - I'm having a few problems figuring out the overall logic.
I have put in palace a test case in the sourceresolve package (not working yet - but its a start on getting usage of this package documented).
Any help on this appreciated.
URLClassLoader( ClassLoader parent, URL[] paths, URLConnectionHandler handler );
constructor?
Anyway, I quick overview of the SourceResolve (you can take part of it
from Fortress) is that the SourceResolve component looks up the
SourceFactory that corresponds to the protocol type we need to handle.
It does so through a ServiceSelector:
Client SourceResolver ServiceSelector SourceFactory
| | |
+------------>| select("resource") |
| resolveURI()+------------------->| |
| | | |
| +-------------------------------------->|
|<------------| resolve() |
| Source |
|
For the URL following here is what happens:
resource:/path/to/classloader/resource.properties
The SourceResolver will first check to see if there is a SourceFactory
bound to the protocol name such as "resource" inside of the
ServiceSelector. If it finds one, it invokes the resolve() method
on the factory to get the Source. Otherwise it will default to the
normal URL handling mechanisms in Java.
When you are done with the Source, you release it.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]