You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@synapse.apache.org by in...@apache.org on 2008/05/10 14:14:52 UTC

svn commit: r655063 - /synapse/branches/1.2/modules/core/src/main/java/org/apache/synapse/endpoints/SALoadbalanceEndpoint.java

Author: indika
Date: Sat May 10 05:14:52 2008
New Revision: 655063

URL: http://svn.apache.org/viewvc?rev=655063&view=rev
Log:
fix a just mistake

Modified:
    synapse/branches/1.2/modules/core/src/main/java/org/apache/synapse/endpoints/SALoadbalanceEndpoint.java

Modified: synapse/branches/1.2/modules/core/src/main/java/org/apache/synapse/endpoints/SALoadbalanceEndpoint.java
URL: http://svn.apache.org/viewvc/synapse/branches/1.2/modules/core/src/main/java/org/apache/synapse/endpoints/SALoadbalanceEndpoint.java?rev=655063&r1=655062&r2=655063&view=diff
==============================================================================
--- synapse/branches/1.2/modules/core/src/main/java/org/apache/synapse/endpoints/SALoadbalanceEndpoint.java (original)
+++ synapse/branches/1.2/modules/core/src/main/java/org/apache/synapse/endpoints/SALoadbalanceEndpoint.java Sat May 10 05:14:52 2008
@@ -343,19 +343,23 @@
             active = endpointContext.isActive();
             if (!active && endpoints != null) {
                 for (Endpoint ep : endpoints) {
-                    if (ep.isActive(synMessageContext)) { //AND at least one child endpoint is active
-                        active = true;
-                        endpointContext.setActive(true);
-                        // don't break the loop though we found one active endpoint. calling isActive()
-                        // on all child endpoints will update their active state. so this is a good
-                        // time to do that.
+                    if (ep != null) {
+                        active = ep.isActive(synMessageContext);
+                        if (active) {    //AND at least one child endpoint is active
+                            endpointContext.setActive(active);
+                            // don't break the loop though we found one active endpoint. calling isActive()
+                            // on all child endpoints will update their active state. so this is a good
+                            // time to do that.
+                        }
                     }
                 }
             }
         } else {
             //If a session is started AND the binding endpoint is active.
             active = endpoint.isActive(synMessageContext);
-            endpointContext.setActive(active);
+            if (active) {
+                endpointContext.setActive(active);
+            }
         }
         return active;
     }