debugging DatabaseCache
[mir.git] / source / mir / misc / MirConfig.java
index 5f0f96b..0cf4859 100755 (executable)
@@ -6,6 +6,7 @@ import  java.io.*;
 import  java.util.*;
 import  java.lang.*;
 import  com.javaexchange.dbConnectionBroker.*;
+import         mir.storage.StorageObjectException;
 
 /**
  * Title:        Mir
@@ -43,7 +44,6 @@ public class MirConfig extends Configuration {
 
     configHash.put("Home", home);
     configHash.put("RootUri", uri);
-    configHash.put("ServletName", name);
 
     Enumeration resKeys = getResourceKeys();
     while(resKeys.hasMoreElements()) {
@@ -51,14 +51,22 @@ public class MirConfig extends Configuration {
       configHash.put(keyNm, getProperty(keyNm));
     }
   }
-
   /**
    * Returns the property asked for by pulling it out a HashMap
    * @param a String containing the property name (key)
    * @return a String containing the prop. value
    */
-  public static String getProp(String PropName) {
-    return (String)configHash.get(PropName);
+  public static void setServletName(String servletName) {
+    configHash.put("ServletName",servletName);
+  }
+  
+  /**
+   * Returns the property asked for by pulling it out a HashMap
+   * @param a String containing the property name (key)
+   * @return a String containing the prop. value
+   */
+  public static String getProp(String propName) {
+    return (String)configHash.get(propName);
   }
 
   /**
@@ -67,12 +75,12 @@ public class MirConfig extends Configuration {
    * @param a String containing the property name (key)
    * @return a String containing the prop.value
    */
-  public static String getPropWithHome(String PropName) {
+  public static String getPropWithHome(String propName) {
     return (String)configHash.get("Home") +
-           (String)configHash.get(PropName);
+           (String)configHash.get(propName);
   }
 
-  public static void addBroker(String driver, String URL){
+  public static void addBroker(String driver, String URL) throws StorageObjectException {
 
     String username,passwd,min,max,log,reset;
 
@@ -95,12 +103,11 @@ public class MirConfig extends Configuration {
         if (br!=null){
           instances++;
           brokerHash.put("Pool.broker",br);
-        } else {
-            throw new Exception();
         }
-      } catch(Exception e){
+      } catch(IOException e){
         System.err.println("Der ConnectionBroker konnte nicht initializiert werden"+ e.toString());e.printStackTrace();
-      }
+        throw new StorageObjectException(e.toString());
+           }
     } // end if
   }