Carsten Ziegeler wrote:

Sylvain Wallez wrote:
Makes sense. IIRC this was already mentioned in the past when we discussed "source store", i.e. a source-oriented front-end to the store that allows objects read from sources (stylesheets, sitemaps, forms, templates, etc) to be more memory-friendly by being kept in the store rather than in private caches.

The reloading policy would then be implemented in this "source store" component, once for all components that use it. This allows also to centrally implement the reload delay that also exists on the sitemap, and which directs the system to check for modification only periodically, thus reducing the number of filesystem hits under load.

Now this requires quite a number of changes, so let's keep a global "check-reload" for the sitemap and condiser source stores after 2.1.8.

I'm talking of 2.2 only, so what should we do there? :)

Ah, ok :-)

Now, rethinking this and considering Max reply, it might make sense to
allow reloads of the one kind in production but not for others to avoid
the checking on each request (or the delayed check).

So what about a global property:
o.a.c.reloading=true|false
and using a "sub" properties like
o.a.c.reloading.sitemap and o.a.c.reloading.xslt and so on.

Interesting idea. Thinking more to the source cache thing, I thing this component should be actually a provider for separate objects, as different components may use the same file in different ways. I'm thinking here to a bug I fixed a long time ago where XSP and XSLTProcessor used the same cache entry to store different objects associated to a logicsheet.

So the sub-category could also be used as an identifier of the cache store.

Let's explain with a few lines of code:

SourceStoreFactory ssf = (SourceStoreFactory)manager.lookup(SourceStoreFactory.ROLE);
this.sourceStore = ssf.createStore("sitemap");
...
Processor proc = this.sourceStore.get(source);
if (proc == null) {
   Processor proc = buildProcessor(source);
   this.sourceStore.store(source, proc);
}

The source store will then store in the real store an entry related to its name and the source's URI and validity, and automatically handle the reloading configuration and delay.

The "sub" properties default to o.a.c.reloading unlike otherwise specified.

The source store which we might have at some point can use this property
as well. Clients of the source store always specify the "type" like
sitemap or xslt

Yes!

Sylvain

--
Sylvain Wallez                        Anyware Technologies
http://people.apache.org/~sylvain     http://www.anyware-tech.com
Apache Software Foundation Member     Research & Technology Director

Reply via email to