Hi,

I've written generators, and caching generators which extend the
non-caching components and implement CachingPipelineComponent. The
isValid(CacheKey) method is as follows:

  /**
   * Check if caching period expired.
   *
   * @see
org.apache.cocoon.pipeline.caching.AbstractCacheKey#isValid(CacheKey)
   */
  @Override
  public boolean isValid(final CacheKey other) {
    if (!(other instanceof FileCaching)) {
      return false;
    }

    final FileCaching otherCacheKey =
        (FileCaching) other;
    return this.mTimestamp == otherCacheKey.mTimestamp;
  }

Basically mTimestamp is the last timestamp a file has been modified
(file.lastModified()). I assume that's correct, but it always responds
with the same file even if it changes:

    <map:pipeline jmx-group-name="timestamp-caching">
      <map:match pattern="caching-pipeline/on">
        <map:generate type="cachingttsax" src="test"/>
        <map:serialize/>
      </map:match>
    </map:pipeline>
    
    <map:pipeline type="async-caching" jmx-group-name="async-caching">
      <map:match pattern="async-caching-pipeline/on">
        <map:generate type="cachingttsax" src="test"/>
        <map:serialize type="xml"/>
      </map:match>
    </map:pipeline>

Even from within another pipeline.

regards,
Johannes

    <map:pipeline type="noncaching" jmx-group-name="nocaching">
      <map:match pattern="caching-pipeline/off">
        <map:generate type="cachingttsax" src="test"/>
        <map:serialize type="xml"/>
      </map:match>
    </map:pipeline>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org

Reply via email to