Author: rajika
Date: Tue May 26 23:30:30 2009
New Revision: 36943
URL: http://wso2.org/svn/browse/wso2?view=rev&revision=36943

Log:
Fixed SALoadBalance serialization issue.

Modified:
   
branches/synapse/1.3-wso2v1/modules/core/src/main/java/org/apache/synapse/config/xml/endpoints/SALoadbalanceEndpointSerializer.java

Modified: 
branches/synapse/1.3-wso2v1/modules/core/src/main/java/org/apache/synapse/config/xml/endpoints/SALoadbalanceEndpointSerializer.java
URL: 
http://wso2.org/svn/browse/wso2/branches/synapse/1.3-wso2v1/modules/core/src/main/java/org/apache/synapse/config/xml/endpoints/SALoadbalanceEndpointSerializer.java?rev=36943&r1=36942&r2=36943&view=diff
==============================================================================
--- 
branches/synapse/1.3-wso2v1/modules/core/src/main/java/org/apache/synapse/config/xml/endpoints/SALoadbalanceEndpointSerializer.java
 (original)
+++ 
branches/synapse/1.3-wso2v1/modules/core/src/main/java/org/apache/synapse/config/xml/endpoints/SALoadbalanceEndpointSerializer.java
 Tue May 26 23:30:30 2009
@@ -22,6 +22,7 @@
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMElement;
 import org.apache.synapse.SynapseConstants;
+import org.apache.synapse.config.xml.XMLConfigConstants;
 import org.apache.synapse.endpoints.Endpoint;
 import org.apache.synapse.endpoints.SALoadbalanceEndpoint;
 import org.apache.synapse.endpoints.algorithms.LoadbalanceAlgorithm;
@@ -84,13 +85,10 @@
                 = fac.createOMElement("loadbalance", 
SynapseConstants.SYNAPSE_OMNAMESPACE);
         endpointElement.addChild(loadbalanceElement);
 
-        LoadbalanceAlgorithm algorithm = loadbalanceEndpoint.getAlgorithm();
-        String algorithmName = "roundRobin";
-        if (algorithm instanceof RoundRobin) {
-             algorithmName = "roundRobin";
-        }
-        loadbalanceElement.addAttribute("algorithm", algorithmName, null);
-
+        
loadbalanceElement.addAttribute(XMLConfigConstants.LOADBALANCE_ALGORITHM,
+                loadbalanceEndpoint.getAlgorithm().getClass().getName(),
+                null);
+        
         for (Endpoint childEndpoint : loadbalanceEndpoint.getChildren()) {
             
loadbalanceElement.addChild(EndpointSerializer.getElementFromEndpoint(childEndpoint));
         }

_______________________________________________
Esb-java-dev mailing list
[email protected]
https://wso2.org/cgi-bin/mailman/listinfo/esb-java-dev

Reply via email to