Turns out that it was a bug in the build of Cocoon I was using. I did a fresh pull and got NPEs instead just like Jeff Turner found. After yet another CVS pull, I don't get any errors, and it's caching, but it never detects the timestamp change.

My logs show the timestamp value changing and the TimeStampValidity object is simple enough that I can rule a bug there out. Is there a bug on this or should I chalk it up to birthing pains of the new cache engine?

Is anyone else able to get it working with TimeStampValidity (basically a SourceValidity that only succeeds when compared to another SourceValidity object of the same type)?

If I can get this working, you all can have a brand spanking new DirectoryGenerator that caches -- and works with all existing subclasses except for XPathGenerator for which I have a patch. Any takers?

- Miles

P.S. I have a question about the existing DirectoryGenerator. What is the "root" parameter for? Is it what I think it is: a regex on extries off the generator context root? The docs aren't particularly clear and the code can only tell me implementation -- not intent.

Miles Elam wrote:

I'm going through the process of writing my first generator. I works fine for what I need it to do, but I can't seem to get caching to work with it. My generator extends from ComposerGenerator and implements CacheableProcessingComponent.

I have implemented the following methods:

public java.io.Serializable generateKey()
public SourceValidity generateValidity()

My key is quite unique (and verbose). I am using TimeStampValidity from Excalibur. I put in some debug statements and I can confirm that the key and the timestamp are staying the same (and are not null/0) -- which actually fits with the behavior.

The behavior is that the first (uncached) call works fine. All subsequent calls give me an empty page...or rather it gives me

<html><body></body></html>

even though I am accessing a URL with only the generator and the XML serializer in the pipeline. The caching engine can see that I want it cached and that it is currently cacheable. There is of course more to the component than this, but nothing that I know is related to caching. All of my output is done through this.contentHandler.[SAX method] and without caching, it works fine.

What am I missing?

- Miles

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to