On Wed, Jul 1, 2009 at 6:03 PM, Craig Taverner<cr...@amanzi.com> wrote:
> We've tested the FileLocator code directly in modified JRuby code, but have
> not yet removed it and tested with the new approach above. If it works, it
> represents a way to achieve what we need without modifying JRuby. One
> problem with this approach is that we duplicate the code of the
> 'findFileInClasspath' method, and if that changes with JRuby upgrades we
> have to notice that and incorporate the changes. The method is only about 50
> lines long, but still. A more durable hack would be to have a hook in the
> findFileInClasspath method that calls a URL rewriter method, which has a
> default implementation in the JRuby code that simply returns the URL. Then
> we would only have to overwrite that method, instead of the whole 50 lines.

Well, that's a pretty good idea. We could certainly structure it that
way. LoadService needs more refactoring/cleanup in general, and
ideally I have always wanted it to either work more like classloading
does (cascading hierarchy of searches) or to allow simple registration
of lookup logic. That would allow you to add your own
classloader-based searches using specialized URL logic.

I'm really open to any suggestion here. Along with handling these
custom URLs, we would also like to be able to handle
resources-within-resources, which requires similar custom URL
handling. So a general approach is certainly needed.

If you want to mock up an idea or patch and stick it into a JIRA
"feature" bug, we could go from there and try to get it into JRuby
proper.

- Charlie

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to