[jdom-interest] JDOM 2.x additional features

Rolf Lear jdom at tuis.net
Fri Apr 13 07:47:20 PDT 2012


Currently the resolver is just a 'simple' file system cache, with some 
'smart' logic in Java to allow that cache to be accessed concurrently by 
multiple threads, and multiple JVM's. It uses File-locking to accomplish 
this.

The 'specification' for the cache file structure is 'easy'. There is no 
reason why you can't zip up the cache, move it, add to it, etc.

Note that the Resolver project I have proposed fills a gap between two 
different existing concepts: the current 'get it when I need it' 
Resolver we normally use; and the existing concept of a web catalog, 
which is a static pre-loaded, unmodifiable.

If all you want to do is pre-cache existing, known DTD's and Schemas you 
may want to just use existing web-catalog concepts.

Have a look at the 'motivation' page for 'my' ideas of why a different 
Resolver is needed: 
https://github.com/rolfl/Resolver/wiki/Motivation-and-Requirements

Currently the resolver technically works. I have tested it 'extensively' 
in a multi-threaded and multi-JVM test suite.

Now that JDOM 2.0.0 is out, I can put some more thought in to how best 
to 'package' the Resolver. It technically does not even need to be a 
part of JDOM...

But, I do think JDOM would be better if it provided an easy way to 
integrate multiple resolvers for XML Parsing... giving it the ability to 
'use a web catalog for *this*', 'use a direct web access for *that*', 
and 'use the cache for *that*'.

In the long run I think it would be really nice if you could do 
something like:

JDOMResolver myres = new JDOMResolver();
myres.addChainedResolver(new WebCatalog("path/to/catalog"));
myres.addChainedResolver(new WebCatalog("path/to/some/other/catalog"));
myres.addChainedResolver(new FilteredResolver("my.local.host.com"));
myres.addChainedResolver(new CachingResolver());

SAXBuilder sb = new SaxBuilder();
sb.setEntityResolver(myres);

But, that is a change for a later version of JDOM... It will need some 
more input (maybe from people like you ... ;-)

Rolf



On 13/04/2012 10:30 AM, Chris Pratt wrote:
> Does the resolver have the ability to preload DTDs/Schemas? I know there
> have been several times it would have been nice to be able to pre-cache
> documents I know I'm going to need, rather than waiting until the first
> request.
>    (*Chris*)
>
> On Apr 13, 2012 12:40 AM, "Noel Grandin" <noel at peralex.com
> <mailto:noel at peralex.com>> wrote:
>
>     OOOh, I'd love a nice resolver solution.
>     I live in sunny South Africa, with lovely beaches, and incredibly
>     high latency internet connections, so reducing resolver calls helps
>     a lot :-)
>
>     On 2012-04-12 20:46, Rolf Lear wrote:
>
>         'On the side' I have started the 'Resolver' project. This is
>         hosted on
>         github: https://github.com/rolfl/__Resolver
>         <https://github.com/rolfl/Resolver> This project comes directly from
>         the JDOM work because I did much of my JDOM work on the train,
>         without an
>         internet connection, and I needed to 'resolve' XSD and other
>         resources from
>         the web. If the Resolver project gets some interest, I am sure
>         it would
>         make some sense to at least consider moving it in to JDOM.
>
>
>     Disclaimer: http://www.peralex.com/__disclaimer.html
>     <http://www.peralex.com/disclaimer.html>
>
>
>     _________________________________________________
>     To control your jdom-interest membership:
>     http://www.jdom.org/mailman/__options/jdom-interest/__youraddr@yourhost.com
>     <http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com>
>



More information about the jdom-interest mailing list