Reinhard Poetz wrote:
Reinhard Poetz wrote:
Because of dependencies on the event-cache block, the caching source
was added to the repository block when it moved out from scratchpad.
After some refactorings I should be able now to move it to cocoon-core
without having to add any new depenendencies there.
As a caching source is of general interest for many of our users (see
several requests on the users list) I want to propose to move it to
cocoon-core.
The proposal has been accepted. It got 7 binding +1 votes and no -1. I
will move the CachingSource to core as soon as time permits.
Done. I also removed all depenencies on Avalon. The CachingSourceFactory can be
configured as Spring bean now. I added two default configurations "cached" and
"async-cached" which both inherit from the abstract configuration
"org.apache.excalibur.source.SourceFactory/cached::abstract" which is also a
good starting point for custom configurations (e.g. you want to switch the used
cache or the validity strategy).
The tests run through but I don't know what the coverage is. I guess not to
high. Unfortunatly it isn't particularily easy to write tests for the async
mode. Since I need the CachingSource in my own apps very soon, I will hopefully
find any problems caused by my refactorings very soon.
- o -
The only behavioural change that I'm aware of was, that I had to remove the
possibility of inline configurations of the source refresher. The problem is
that Spring doesn't make free-style configurations as simple as Avalon does.
Altough it would be possible to mimick it, it is too much work for something
that can be done using a configuration file IMO.
- o -
There were two reasons why the CachingSourceFactory wasn't already in
cocoon-core: First, it supports InspectableSources and second, it supports
EventAwareCaches.
If you want to use InspectableSources, you can use the
InspectableSourcesAwareCachingSourceFactory* from the repository block.
If you want to use an EventAwareCache you can configure the caching source using
the EventAwareCachingSourceValidityStrategy in combination with a cache that
implements EventAware. The strategy can be found in the event-cache block.
* cool name, isn't it? I know that we can do as good as Spring in inventing
loooong class names ;-)
--
Reinhard Pötz Independent Consultant, Trainer & (IT)-Coach
{Software Engineering, Open Source, Web Applications, Apache Cocoon}
web(log): http://www.poetz.cc
--------------------------------------------------------------------