cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francesco Chicchiriccò <>
Subject Re: [C3] XSLTTransformer cache
Date Thu, 23 Jun 2011 16:42:12 GMT
On 22/06/2011 17:39, Francesco Chicchiriccò wrote:
> On 21/06/2011 18:08, Simone Tripodi wrote:
>> Hi again,
>> that's not log4j but ant[1], it is easy&smart enough that could be
>> imported&  modified depending on our needs...
>> And we could make it generic in the way we can reuse the same policy
>> also in all transformers that require an external resource to be load
>> (i.e. the XSchema validator)
> Very nice idea, Simone (and Sylvain)!
> Tomorrow I'll start importing that Watchdog class from ANT, then I'll 
> replace the current XSLT file caching mechanism with something using 
> this approach.

Today I've been actually working on this topic, but the Watchdog class 
seemed to me too heavy for our purpose.
Basically, it would start a separate thread for each XSLT source 
processed; each thread will be sleeping for some time, then awake and 
reload the XSLT source.

I considered that in most cases the XSLT source is a plain XSLT file, 
and that when this does not apply, the XSLT source can be considered 
rather immutable.

Hence, I've extended the current caching approach used in 
XSLTTransformer and SchemaProcessorTransformer with the capability to 
take into account File.lastModified() when dealing with the cache. Of 
course only when the source is a local file.

All tests (including run successfully and the feature I needed - 
be able to work with XSLT files on a running application - is working as 

For more details, you can take a look at revision 1138969.


Francesco Chicchiriccò

Apache Cocoon Committer and PMC Member

View raw message