Update of /var/cvs/src/org/mmbase/cache
In directory james.mmbase.org:/tmp/cvs-serv6018

Modified Files:
        CacheConfigurationException.java ChainedReleaseStrategy.java 
Log Message:
cleaning only


See also: http://cvs.mmbase.org/viewcvs/src/org/mmbase/cache


Index: CacheConfigurationException.java
===================================================================
RCS file: /var/cvs/src/org/mmbase/cache/CacheConfigurationException.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- CacheConfigurationException.java    6 Jun 2006 21:58:47 -0000       1.3
+++ CacheConfigurationException.java    19 Mar 2008 16:21:25 -0000      1.4
@@ -14,16 +14,17 @@
  *
  * @author Ernst Bunders
  * @since MMBase-1.8
- * @version $Id: CacheConfigurationException.java,v 1.3 2006/06/06 21:58:47 
michiel Exp $
+ * @version $Id: CacheConfigurationException.java,v 1.4 2008/03/19 16:21:25 
michiel Exp $
  */
 public class CacheConfigurationException extends Exception {
 
 
-    /**
-     * @param string
-     */
     public CacheConfigurationException(String string) {
         super(string);
     }
 
+    public CacheConfigurationException(String string, Exception cause) {
+        super(string, cause);
+    }
+
 }


Index: ChainedReleaseStrategy.java
===================================================================
RCS file: /var/cvs/src/org/mmbase/cache/ChainedReleaseStrategy.java,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- ChainedReleaseStrategy.java 19 Mar 2008 16:13:49 -0000      1.25
+++ ChainedReleaseStrategy.java 19 Mar 2008 16:21:25 -0000      1.26
@@ -28,7 +28,7 @@
  *
  * @since MMBase-1.8
  * @author Ernst Bunders
- * @version $Id: ChainedReleaseStrategy.java,v 1.25 2008/03/19 16:13:49 
michiel Exp $
+ * @version $Id: ChainedReleaseStrategy.java,v 1.26 2008/03/19 16:21:25 
michiel Exp $
  */
 public class ChainedReleaseStrategy extends ReleaseStrategy implements 
Iterable<ReleaseStrategy> {
 
@@ -72,10 +72,10 @@
                             log.error("release strategy instance is null.");
                         }
 
-                    } catch (CacheConfigurationException e1) {
+                    } catch (CacheConfigurationException cce) {
                         // here we throw a runtime exception, because there is
                         // no way we can deal with this error.
-                        throw new RuntimeException("Cache configuration error: 
" + e1.toString(), e1);
+                        throw new RuntimeException("Cache configuration error: 
" + cce.getMessage(), cce);
                     }
                 }
             }
@@ -87,32 +87,20 @@
      * @since 1.8.6
      */
     private static ReleaseStrategy getStrategyInstance(String 
strategyClassName) throws CacheConfigurationException {
-        log.debug("getStrategyInstance()");
-        Class strategyClass;
-        ReleaseStrategy strategy = null;
         try {
-            strategyClass = Class.forName(strategyClassName);
-            strategy = (ReleaseStrategy) strategyClass.newInstance();
+            Class strategyClass = Class.forName(strategyClassName);
+            ReleaseStrategy strategy = (ReleaseStrategy) 
strategyClass.newInstance();
             log.debug("created strategy instance: "+strategyClassName);
-
+            return strategy;
         } catch (ClassCastException e){
-            log.debug(strategyClassName + " can not be cast to strategy");
-            throw new CacheConfigurationException(strategyClassName + " can 
not be cast to strategy");
+            throw new CacheConfigurationException("'" + strategyClassName + "' 
can not be cast to strategy.", e);
         } catch (ClassNotFoundException e) {
-            log.debug("exception getStrategyInstance()");
-            throw new CacheConfigurationException("Class "+strategyClassName +
-                    "was not found");
+            throw new CacheConfigurationException("Class '" + 
strategyClassName + "' was not found", e);
         } catch (InstantiationException e) {
-            log.debug("exception getStrategyInstance()");
-            throw new CacheConfigurationException("A new instance of " + 
strategyClassName +
-                    "could not be created: " + e.toString());
+            throw new CacheConfigurationException("A new instance of '" + 
strategyClassName + "' could not be created: " + e.getMessage(), e);
         } catch (IllegalAccessException e) {
-            log.debug("exception getStrategyInstance()");
-            throw new CacheConfigurationException("A new instance of " + 
strategyClassName +
-                    "could not be created: " + e.toString());
+            throw new CacheConfigurationException("A new instance of '" + 
strategyClassName + "' could not be accessed: " + e.getMessage(), e);
         }
-        log.debug("exit getStrategyInstance()");
-        return strategy;
     }
 
 
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to