You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@axis.apache.org by sa...@apache.org on 2012/02/14 10:01:18 UTC

svn commit: r1243832 - /axis/axis2/java/core/branches/1_6/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java

Author: sagara
Date: Tue Feb 14 09:01:18 2012
New Revision: 1243832

URL: http://svn.apache.org/viewvc?rev=1243832&view=rev
Log:
Merged r1243831 to the 1.6 branch.

Modified:
    axis/axis2/java/core/branches/1_6/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java

Modified: axis/axis2/java/core/branches/1_6/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/1_6/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java?rev=1243832&r1=1243831&r2=1243832&view=diff
==============================================================================
--- axis/axis2/java/core/branches/1_6/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java (original)
+++ axis/axis2/java/core/branches/1_6/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java Tue Feb 14 09:01:18 2012
@@ -506,22 +506,12 @@ public class AxisConfiguration extends A
         Iterator<AxisService> services = axisServiceGroup.getServices();
         boolean isClientSide = false;
         while (services.hasNext()) {
-            AxisService axisService = services.next();
-            allServices.remove(axisService.getName());
-            if (!axisService.isClientSide()) {
-                notifyObservers(new AxisEvent(AxisEvent.SERVICE_REMOVE , axisService), axisService);
-            } else {
-                isClientSide = true;
-            }
+            AxisService axisService = services.next();           
+            isClientSide = axisService.isClientSide()? true : false;
 
             //removes the endpoints to this service
             String serviceName = axisService.getName();
-            String key;
-
-            for (String s : axisService.getEndpoints().keySet()) {
-                key = serviceName + "." + s;
-                this.allEndpoints.remove(key);
-            }
+            removeServiceReferences(axisService.getName());    
 
         }
         removeChild(serviceGroupName);
@@ -686,7 +676,7 @@ public class AxisConfiguration extends A
      * @throws AxisFault
      */
     public synchronized void removeService(String name) throws AxisFault {
-        AxisService service = allServices.remove(name);
+        AxisService service = removeServiceReferences(name);
         if (service != null) {
             AxisServiceGroup serviceGroup = service.getAxisServiceGroup();
             serviceGroup.removeService(name);
@@ -1545,4 +1535,23 @@ public class AxisConfiguration extends A
         }
         return childFirstClassLoading;
     }
+    
+    private AxisService removeServiceReferences(String serviceName) {
+
+        AxisService axisService = allServices.remove(serviceName);
+        if (axisService != null) {
+            if (!axisService.isClientSide()) {
+                notifyObservers(new AxisEvent(AxisEvent.SERVICE_REMOVE,
+                        axisService), axisService);
+            }
+
+            // removes the endpoints to this service
+            for (Iterator<String> iter = axisService.getEndpoints().keySet()
+                    .iterator(); iter.hasNext();) {
+                String key = serviceName + "." + iter.next();
+                this.allEndpoints.remove(key);
+            }
+        }
+        return axisService;
+    }
 }