ghoward     2003/09/18 15:07:39

  Modified:    src/webapp/samples/xsp/java cacheable.xsp
  Log:
  Use new excalibur source validity.  Was there any reason to
  use the compatibility mode or is this just legacy?
  
  Revision  Changes    Path
  1.2       +4 -5      cocoon-2.1/src/webapp/samples/xsp/java/cacheable.xsp
  
  Index: cacheable.xsp
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/webapp/samples/xsp/java/cacheable.xsp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- cacheable.xsp     7 Sep 2003 06:09:10 -0000       1.1
  +++ cacheable.xsp     18 Sep 2003 22:07:39 -0000      1.2
  @@ -18,8 +18,7 @@
   
   <xsp:structure>
       <xsp:include>org.apache.excalibur.source.SourceValidity</xsp:include>
  -    
<xsp:include>org.apache.cocoon.caching.CacheValidityToSourceValidity</xsp:include>
  -    
<xsp:include>org.apache.cocoon.caching.DeltaTimeCacheValidity</xsp:include>
  +    
<xsp:include>org.apache.excalibur.source.impl.validity.ExpiresValidity</xsp:include>
       <xsp:include>java.io.Serializable</xsp:include>
   </xsp:structure>
   
  @@ -28,6 +27,7 @@
       // artificial slowdown to make the effects of the cache visible
       final int DELAY_SECS = 2;
   
  +     // request parameter "validity" contains number of seconds to cache
       private int getValidityFromRequest() {
           int result = 15;
           try {
  @@ -69,8 +69,7 @@
       */
       public SourceValidity getValidity() {
          // keep in cache for our validity time
  -       return CacheValidityToSourceValidity.createValidity(
  -           new DeltaTimeCacheValidity(0, getValidityFromRequest()));
  +       return new ExpiresValidity(getValidityFromRequest()*1000);
       }
    </xsp:logic>
   
  
  
  

Reply via email to