[Yanel-commits] rev 48801 - public/yanel/trunk/src/core/java/org/wyona/yanel/core/map

michi at wyona.com michi at wyona.com
Wed Apr 14 21:36:20 CEST 2010


Author: michi
Date: 2010-04-14 21:36:19 +0200 (Wed, 14 Apr 2010)
New Revision: 48801

Modified:
   public/yanel/trunk/src/core/java/org/wyona/yanel/core/map/RealmManager.java
Log:
javadoc and log statements improved

Modified: public/yanel/trunk/src/core/java/org/wyona/yanel/core/map/RealmManager.java
===================================================================
--- public/yanel/trunk/src/core/java/org/wyona/yanel/core/map/RealmManager.java	2010-04-14 18:53:42 UTC (rev 48800)
+++ public/yanel/trunk/src/core/java/org/wyona/yanel/core/map/RealmManager.java	2010-04-14 19:36:19 UTC (rev 48801)
@@ -68,24 +68,25 @@
 
     /**
      * Initializes realms
-     * @param yanelConfigurationFile Yanel configuration, something like yanel.xml or yanel.properties
+     * @param yanelConfigurationFilename Yanel configuration filename, either 'yanel.xml' or 'yanel.properties'
      */
-    public RealmManager(String yanelConfigurationFile) throws ConfigurationException {
-        log.debug("Yanel Configuration: " + yanelConfigurationFile);
-        File realmsConfigFile = getSetRealmsConfigFile(yanelConfigurationFile);
+    public RealmManager(String yanelConfigurationFilename) throws ConfigurationException {
+        log.debug("Yanel Configuration Filename: " + yanelConfigurationFilename);
+        File realmsConfigFile = getSetRealmsConfigFile(yanelConfigurationFilename);
         log.debug("Realms Configuration: " + realmsConfigFile);
         readRealms(realmsConfigFile);
     }
 
     /**
      * Get realms configuration file
-     * @param yanelConfigurationFile Yanel configuration, something like yanel.xml or yanel.properties
+     * @param yanelConfigurationFilename Yanel configuration filename, either 'yanel.xml' or 'yanel.properties'
      * @return Something like realms.xml
      */
-    public File getSetRealmsConfigFile(String yanelConfigurationFile) throws ConfigurationException {
-        YANEL_CONFIGURATION_FILE = yanelConfigurationFile;
+    private File getSetRealmsConfigFile(String yanelConfigurationFilename) throws ConfigurationException {
+        YANEL_CONFIGURATION_FILE = yanelConfigurationFilename;
 
         if (RealmManager.class.getClassLoader().getResource(YANEL_CONFIGURATION_FILE) == null) {
+            log.warn("No such configuration file '" + YANEL_CONFIGURATION_FILE + "' in classpath, hence use default filename: " + Yanel.DEFAULT_CONFIGURATION_FILE);
             YANEL_CONFIGURATION_FILE = Yanel.DEFAULT_CONFIGURATION_FILE;
         }
 
@@ -142,15 +143,19 @@
                     throw new ConfigurationException("Could not load realms configuration file: " + propertiesURL);
                 }
             } else {
-                log.error(YANEL_CONFIGURATION_FILE + " has to be either .xml or .properties");
+                log.error(YANEL_CONFIGURATION_FILE + " has to be either '.xml' or '.properties'");
             }
         } else {
-            log.error("No such configuration file: " + RealmManager.class.getClassLoader().getResource(YANEL_CONFIGURATION_FILE));
+            log.error("No such configuration file in classpath: " + YANEL_CONFIGURATION_FILE);
         }
+
         if (realmsConfigFile == null) {
             throw new ConfigurationException("Realms configuration file could not be determined!");
         }
+
+        // INFO: Set private realms config file
         _realmsConfigFile = realmsConfigFile;
+
         return realmsConfigFile;
     }
 



More information about the Yanel-commits mailing list