Author: ruwan
Date: Tue Nov 28 03:46:13 2006
New Revision: 480005

URL: http://svn.apache.org/viewvc?view=rev&rev=480005
Log:
committing for chathura

Modified:
    
incubator/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/SynapseConfiguration.java
    
incubator/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/XMLConfigurationBuilder.java
    
incubator/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/registry/url/SimpleURLRegistry.java

Modified: 
incubator/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/SynapseConfiguration.java
URL: 
http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/SynapseConfiguration.java?view=diff&rev=480005&r1=480004&r2=480005
==============================================================================
--- 
incubator/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/SynapseConfiguration.java
 (original)
+++ 
incubator/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/SynapseConfiguration.java
 Tue Nov 28 03:46:13 2006
@@ -28,7 +28,8 @@
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
- 
+import org.apache.axiom.om.OMNode;
+
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLStreamException;
@@ -194,6 +195,26 @@
                     handleException("Can not load the source property : " + 
value.getName());
                 }
             }
+
+            if (value.getType() == Property.DYNAMIC_TYPE) {
+
+                Registry registry = getRegistry(value.getRegistryName());
+
+                if (registry == null) {
+                    handleException("Registry not available.");
+                }
+
+                OMNode node = null;
+                try {
+                    node = registry.lookup(value.getKey());
+                    if (node == null) {
+                        handleException("Registry key should map to a XML 
resource.");
+                    }
+                } catch (Exception e) {
+                    handleException("Registry key should map to a XML 
resource.");
+                }
+            }
+
             globalProps.put(name, value);
         } else {
             log.error("Name and the value of the property cannot be null");

Modified: 
incubator/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/XMLConfigurationBuilder.java
URL: 
http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/XMLConfigurationBuilder.java?view=diff&rev=480005&r1=480004&r2=480005
==============================================================================
--- 
incubator/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/XMLConfigurationBuilder.java
 (original)
+++ 
incubator/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/XMLConfigurationBuilder.java
 Tue Nov 28 03:46:13 2006
@@ -62,6 +62,19 @@
         }
         root.build();
 
+        Iterator regs = root.getChildrenWithName(Constants.REGISTRY_ELT);
+        if (regs != null) {
+            while (regs.hasNext()) {
+                Object o = regs.next();
+                if (o instanceof OMElement) {
+                    Registry reg = RegistryFactory.createRegistry((OMElement) 
o);
+                    config.addRegistry(reg.getRegistryName(), reg);
+                } else {
+                    handleException("Invalid registry declaration in 
configuration");
+                }
+            }
+        }
+
         OMContainer definitions = 
root.getFirstChildWithName(Constants.DEFINITIONS_ELT);
         if (definitions != null) {
 
@@ -94,19 +107,6 @@
                         ProxyService proxy = 
ProxyServiceFactory.createProxy(elt);
                         config.addProxyService(proxy.getName(), proxy);
                     }
-                }
-            }
-        }
-
-        Iterator regs = root.getChildrenWithName(Constants.REGISTRY_ELT);
-        if (regs != null) {
-            while (regs.hasNext()) {
-                Object o = regs.next();
-                if (o instanceof OMElement) {
-                    Registry reg = RegistryFactory.createRegistry((OMElement) 
o);
-                    config.addRegistry(reg.getRegistryName(), reg);
-                } else {
-                    handleException("Invalid registry declaration in 
configuration");
                 }
             }
         }

Modified: 
incubator/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/registry/url/SimpleURLRegistry.java
URL: 
http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/registry/url/SimpleURLRegistry.java?view=diff&rev=480005&r1=480004&r2=480005
==============================================================================
--- 
incubator/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/registry/url/SimpleURLRegistry.java
 (original)
+++ 
incubator/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/registry/url/SimpleURLRegistry.java
 Tue Nov 28 03:46:13 2006
@@ -164,7 +164,16 @@
                     String key = "";
                     while((key=reader.readLine()) != null) {
                         URLRegistryEntry registryEntry = new 
URLRegistryEntry();
-                        registryEntry.setKey(entry.getKey() + "/" + key);
+                        if(entry.getKey().equals("")) {
+                            registryEntry.setKey(key);
+                        } else {
+                            if(entry.getKey().endsWith("/")) {
+                                  registryEntry.setKey(entry.getKey() + key);
+                            } else {
+                                  registryEntry.setKey(entry.getKey() + "/" + 
key);
+                            }
+                        }
+
                         entryList.add(registryEntry);
                     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to