cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: cocoon-2.1/src/java/org/apache/cocoon/caching/impl CacheImpl.java
Date Fri, 08 Aug 2003 11:15:11 GMT
cziegeler    2003/08/08 04:15:11

  Modified:    src/java/org/apache/cocoon/caching/impl CacheImpl.java
  Log:
  Adding debug statements
  
  Revision  Changes    Path
  1.7       +16 -2     cocoon-2.1/src/java/org/apache/cocoon/caching/impl/CacheImpl.java
  
  Index: CacheImpl.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/caching/impl/CacheImpl.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- CacheImpl.java	7 Aug 2003 08:52:15 -0000	1.6
  +++ CacheImpl.java	8 Aug 2003 11:15:11 -0000	1.7
  @@ -113,6 +113,9 @@
       public void store(Serializable     key,
                         CachedResponse   response)
       throws ProcessingException {
  +        if ( this.getLogger().isDebugEnabled()) {
  +            this.getLogger().debug("Caching new response for " + key);
  +        }
           try {
               this.store.store(key, response);
           } catch (IOException ioe) {
  @@ -127,7 +130,12 @@
        *                    request
        */
       public CachedResponse get(Serializable key) {
  -        return (CachedResponse)this.store.get(key);
  +        final CachedResponse r = (CachedResponse)this.store.get(key);
  +        if ( this.getLogger().isDebugEnabled()) {
  +            this.getLogger().debug("Cached response for " + key + " : " + 
  +                                   (r == null ? "not found" : "found"));
  +        }
  +        return r;
       }
   
       /**
  @@ -137,6 +145,9 @@
        *                    request
        */
       public void remove(Serializable key) {
  +        if ( this.getLogger().isDebugEnabled()) {
  +            this.getLogger().debug("Removing cached response for " + key); 
  +        }
           this.store.remove(key);
       }
   
  @@ -144,6 +155,9 @@
        * clear cache of all cached responses 
        */
       public void clear() {
  +        if ( this.getLogger().isDebugEnabled()) {
  +            this.getLogger().debug("Clearing cache"); 
  +        }
           // FIXME this clears the whole store!
           this.store.clear();
       }
  
  
  

Mime
View raw message