You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2003/08/07 15:28:50 UTC

cvs commit: cocoon-2.1/src/java/org/apache/cocoon/acting ClearCacheAction.java

cziegeler    2003/08/07 06:28:50

  Modified:    src/java/org/apache/cocoon/acting ClearCacheAction.java
  Log:
  Make clearing the cache configurable
  
  Revision  Changes    Path
  1.2       +6 -4      cocoon-2.1/src/java/org/apache/cocoon/acting/ClearCacheAction.java
  
  Index: ClearCacheAction.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/acting/ClearCacheAction.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ClearCacheAction.java	9 Mar 2003 00:08:38 -0000	1.1
  +++ ClearCacheAction.java	7 Aug 2003 13:28:50 -0000	1.2
  @@ -73,14 +73,16 @@
                       String src,
                       Parameters par
       ) throws Exception {
  -        Cache cache = (Cache)this.manager.lookup(Cache.ROLE);
  +        final String cacheRole = par.getParameter("cache-role", Cache.ROLE);
  +        Cache cache = null;
   
           try {
  +            cache = (Cache)this.manager.lookup(cacheRole);
               cache.clear();
               return EMPTY_MAP;
           } catch (Exception ex) {
  -	    if (this.getLogger().isDebugEnabled()) {
  -                getLogger().debug("Exception while trying to Clear Cache", ex);
  +	        if (this.getLogger().isDebugEnabled()) {
  +                getLogger().debug("Exception while trying to clear Cache with role " + cacheRole, ex);
               }
               return null;
           } finally {