Update of /var/cvs/src/org/mmbase/util
In directory james.mmbase.org:/tmp/cvs-serv2667

Modified Files:
        ApplicationContextReader.java 
Log Message:
Added some recursion to recognized 'sub' contexes. This is to effectively make 
mmbase-resources/utils/multicast.xml work....


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


Index: ApplicationContextReader.java
===================================================================
RCS file: /var/cvs/src/org/mmbase/util/ApplicationContextReader.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- ApplicationContextReader.java       24 Feb 2007 21:57:50 -0000      1.4
+++ ApplicationContextReader.java       11 Jul 2008 17:34:01 -0000      1.5
@@ -17,7 +17,7 @@
  *
  * @author Nico Klasens
  * @since MMBase 1.8.1
- * @version $Id: ApplicationContextReader.java,v 1.4 2007/02/24 21:57:50 
nklasens Exp $
+ * @version $Id: ApplicationContextReader.java,v 1.5 2008/07/11 17:34:01 
michiel Exp $
  */
 public class ApplicationContextReader {
 
@@ -35,9 +35,17 @@
             while (ne.hasMoreElements()) {
                 NameClassPair element = ne.nextElement();
                 String contextName = element.getName();
+
                 String lookupName = env.composeName(contextName, path);
-                String value = env.lookup(lookupName).toString();
-                properties.put(contextName, value);
+                Object value = env.lookup(lookupName);
+                if (value instanceof Context) {
+                    Map<String, String> subProps = getProperties(path + "/" + 
contextName);
+                    for (Map.Entry<String, String> entry : 
subProps.entrySet()) {
+                        properties.put(contextName + "/" + entry.getKey(), 
entry.getValue());
+                    }
+                } else {
+                    properties.put(contextName, value.toString());
+                }
             }
         }
         return properties;
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to