cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject cvs commit: xml-cocoon2/src/java/org/apache/cocoon/generation ServerPagesGenerator.java
Date Sat, 20 Apr 2002 04:02:18 GMT
vgritsenko    02/04/19 21:02:18

  Modified:    src/java/org/apache/cocoon/generation
                        ServerPagesGenerator.java
  Log:
  optimize validity object creation
  
  Revision  Changes    Path
  1.14      +8 -10     xml-cocoon2/src/java/org/apache/cocoon/generation/ServerPagesGenerator.java
  
  Index: ServerPagesGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/generation/ServerPagesGenerator.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- ServerPagesGenerator.java	22 Feb 2002 07:03:51 -0000	1.13
  +++ ServerPagesGenerator.java	20 Apr 2002 04:02:18 -0000	1.14
  @@ -96,7 +96,7 @@
    *
    * @author <a href="mailto:ricardo@apache.org">Ricardo Rocha</a>
    * @author <a href="mailto:sylvain@apache.org">Sylvain Wallez</a>
  - * @version CVS $Id: ServerPagesGenerator.java,v 1.13 2002/02/22 07:03:51 cziegeler Exp
$
  + * @version CVS $Id: ServerPagesGenerator.java,v 1.14 2002/04/20 04:02:18 vgritsenko Exp
$
    */
   public class ServerPagesGenerator extends ServletGenerator
           implements Disposable, Cacheable, Configurable {
  @@ -148,7 +148,7 @@
        * @return A long representing the cache key (defaults to not cachable)
        */
       public long generateKey() {
  -        return HashUtil.hash(this.inputSource.getSystemId() + generator.generateKey());
  +        return HashUtil.hash(this.inputSource.getSystemId() + '-' + generator.generateKey());
       }
   
       /**
  @@ -158,14 +158,9 @@
        *         component is currently not cachable.
        */
       public CacheValidity generateValidity() {
  -        CacheValidity genValidity = generator.generateValidity();
  -        if (genValidity != null) {
  -            HashMap map = new HashMap(1);
  -            map.put("source", this.inputSource.getSystemId());
  -            ParametersCacheValidity pcv = new ParametersCacheValidity(map);
  -            return new CompositeCacheValidity(genValidity, pcv);
  -        }
  -        return null;
  +        // VG: Input source's systemID is part of the key,
  +        // and need not be included into the validity.
  +        return generator.generateValidity();
       }
   
       /**
  @@ -208,6 +203,9 @@
               getLogger().warn("setup()", e);
               throw new ProcessingException(e.getMessage(), e);
           } catch (NoClassDefFoundError e) {
  +            // VG: Usually indicates that page invoked with the wrong case.
  +            // I.e., it was compiled as "my.xsp" and inoked as "My.xsp",
  +            // results in different class name and an error.
               getLogger().warn("Failed to load class: " + e);
               throw new ResourceNotFoundException(e.getMessage());
           }
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message