axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From az...@apache.org
Subject svn commit: r667797 - /webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/LoadBalancerInterceptor.java
Date Sat, 14 Jun 2008 13:41:07 GMT
Author: azeez
Date: Sat Jun 14 06:41:07 2008
New Revision: 667797

URL: http://svn.apache.org/viewvc?rev=667797&view=rev
Log:
The HTTP/S ports need to be properly set as member attributes


Modified:
    webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/LoadBalancerInterceptor.java

Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/LoadBalancerInterceptor.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/LoadBalancerInterceptor.java?rev=667797&r1=667796&r2=667797&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/LoadBalancerInterceptor.java
(original)
+++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/LoadBalancerInterceptor.java
Sat Jun 14 06:41:07 2008
@@ -95,21 +95,25 @@
                          new String(applicationDomain));
                 LoadBalanceEventHandler eventHandler = lbEventHandlers.get(applicationDomain);
                 if (eventHandler != null) {
-                    org.apache.axis2.clustering.Member axis2Member =
-                            new org.apache.axis2.clustering.Member(TribesUtil.getHost(member),
-                                                                   member.getPort());
-                    Properties props = getProperties(member.getPayload());
-                    int httpPort = Integer.parseInt(props.getProperty("HTTP"));
-                    int httpsPort = Integer.parseInt(props.getProperty("HTTPS"));
-                    axis2Member.setHttpPort(httpPort);
-                    axis2Member.setHttpsPort(httpsPort);
-                    eventHandler.applicationMemberAdded(axis2Member);
+                    eventHandler.applicationMemberAdded(toAxis2Member(member));
                 }
                 break;
             }
         }
     }
 
+    private org.apache.axis2.clustering.Member toAxis2Member(Member member) {
+        org.apache.axis2.clustering.Member axis2Member =
+                new org.apache.axis2.clustering.Member(TribesUtil.getHost(member),
+                                                       member.getPort());
+        Properties props = getProperties(member.getPayload());
+        int httpPort = Integer.parseInt(props.getProperty("HTTP"));
+        int httpsPort = Integer.parseInt(props.getProperty("HTTPS"));
+        axis2Member.setHttpPort(httpPort);
+        axis2Member.setHttpsPort(httpsPort);
+        return axis2Member;
+    }
+
     private Properties getProperties(byte[] payload) {
         Properties props = null;
         try {
@@ -142,11 +146,9 @@
                          new String(applicationDomain));
                 LoadBalanceEventHandler eventHandler = lbEventHandlers.get(applicationDomain);
                 if (eventHandler != null) {
-                    org.apache.axis2.clustering.Member axis2Member =
-                            new org.apache.axis2.clustering.Member(TribesUtil.getHost(member),
-                                                                   member.getPort());
-                    eventHandler.applicationMemberRemoved(axis2Member);
+                    eventHandler.applicationMemberRemoved(toAxis2Member(member));
                 }
+                break;
             }
         }
     }



Mime
View raw message