ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/server/uk/org/iscream/cms/server/core/ConfigurationManagerServant.java
(Generate patch)

Comparing projects/cms/source/server/uk/org/iscream/cms/server/core/ConfigurationManagerServant.java (file contents):
Revision 1.10 by ajm, Thu Mar 1 19:36:08 2001 UTC vs.
Revision 1.13 by tdb, Thu Mar 1 21:06:58 2001 UTC

# Line 99 | Line 99 | class ConfigurationManagerServant extends Configuratio
99          String fileList = "";
100          while (i.hasNext()) {
101              String groupName = (String) i.next();
102 <
102 >            _logger.write(toString(), Logger.DEBUG, "looking for config entry for - " + groupName);
103              // we look for this entry in the systemConfig
104              String configFile = _systemConfig.getProperty("config." + groupName);
105 <            _logger.write(toString(), Logger.DEBUG, "looking for config tree in - " + configFile);
106 <
107 <            // get the file list of includes etc + the system config
108 <            String groupFileList = null;
109 <            try {
110 <                groupFileList = getIncludedFiles(configFile, "") + ";";
111 <            } catch (Exception e) {
112 <                // not sure what to do here
113 <                // so we just log the error
114 <                _logger.write(toString(), Logger.ERROR, "ERROR - " + e);
105 >            // if there is a config entry then
106 >            if (configFile != null) {
107 >                _logger.write(toString(), Logger.DEBUG, "looking for config tree in - " + configFile);
108 >    
109 >                // get the file list of includes etc + the system config
110 >                String groupFileList = null;
111 >                try {
112 >                    groupFileList = getIncludedFiles(configFile, "") + ";";
113 >                } catch (Exception e) {
114 >                    // not sure what to do here
115 >                    // so we just log the error
116 >                    _logger.write(toString(), Logger.ERROR, "ERROR - " + e);
117 >                }
118 >                if (groupFileList != null) {
119 >                    fileList += groupFileList;
120 >                }
121 >            } else {
122 >                _logger.write(toString(), Logger.DEBUG, "no config entry for - " + groupName);
123              }
116            if (groupFileList != null) {
117                fileList += groupFileList;
118            }
124          }
125          // add the system config as the final check
126 <        fileList += _systemConfigFile + ";";
126 >        fileList = _systemConfigFile + ";" + fileList;
127          _logger.write(toString(), Logger.DEBUG, "config tree - " + fileList);
128          
129          // build the configuration
# Line 310 | Line 315 | class ConfigurationManagerServant extends Configuratio
315                  
316                  // some holders for variables
317                  File currentFile;
318 <                long lastModified, newLastModified;
318 >                long lastModified, newLastModified = 0;
319                  Properties properties, prevProperties;
320                  
321                  // the root of all configurations will be the system config
322                  // so we need to open the properties of that
323                  Properties defaultProperties = new Properties();
319                currentFile = new File(_configPath, _systemConfigFile);
320                lastModified = currentFile.lastModified();
321                defaultProperties.load(new FileInputStream(currentFile));
324                  
325                  // This loop then iterates over the file list
326                  // creates the properties to be passed to the
327                  // Configuration constructor
328 <                do {
328 >                while (st.hasMoreTokens()) {
329                      properties = new Properties(defaultProperties);
330                      currentFile = new File(_configPath, st.nextToken());
331                      newLastModified = currentFile.lastModified();
# Line 332 | Line 334 | class ConfigurationManagerServant extends Configuratio
334                      }
335                      properties.load(new FileInputStream(currentFile));
336                      defaultProperties = properties;
337 <                } while (st.hasMoreTokens());
337 >                }
338  
339                  // this creates the configuration, all nice, ready to be returned
340                  ConfigurationServant ref = new ConfigurationServant(properties, fileList, lastModified);
341                  org.omg.CORBA.Object objRef = _refman.getRootPOA().servant_to_reference(ref);
342                  config = ConfigurationHelper.narrow(objRef);
343 <
343 >                _logger.write(toString(), Logger.DEBUG, "returning built configuration");
344              } catch (Exception e) {
345                  // not sure what to do here
346                  // so we just log the error

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines