Skip to content

Instantly share code, notes, and snippets.

@StanAngeloff
Last active August 29, 2015 14:03
Show Gist options
  • Save StanAngeloff/e245a1a349d04efcfad6 to your computer and use it in GitHub Desktop.
Save StanAngeloff/e245a1a349d04efcfad6 to your computer and use it in GitHub Desktop.
diff --git a/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java b/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java
index 621bf00..7dd41e2 100644
see https://github.com/apache/axis2-java/commit/ab6072ef1ecb78e4811e66eae7b6d4e93c765d5b
see https://github.com/apache/axis2-java/commit/b00f147d9e39395b84404b6434e2f63c169f10c8
--- modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java
+++ modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java
@@ -425,22 +425,11 @@ public class AxisConfiguration extends AxisDescription {
boolean isClientSide = false;
while (services.hasNext()) {
AxisService axisService = (AxisService) services.next();
- allServices.remove(axisService.getName());
- if (!axisService.isClientSide()) {
- notifyObservers(AxisEvent.SERVICE_REMOVE, axisService);
- } else {
+ if (axisService.isClientSide()) {
isClientSide = true;
}
- //removes the endpoints to this service
- String serviceName = axisService.getName();
- String key = null;
-
- for (Iterator<String> iter = axisService.getEndpoints().keySet().iterator(); iter.hasNext();){
- key = serviceName + "." + (String)iter.next();
- this.allEndpoints.remove(key);
- }
-
+ removeServiceReferences(axisService.getName());
}
removeChild(serviceGroupName);
if (!isClientSide) {
@@ -610,7 +599,7 @@ public class AxisConfiguration extends AxisDescription {
* @throws AxisFault
*/
public synchronized void removeService(String name) throws AxisFault {
- AxisService service = (AxisService) allServices.remove(name);
+ AxisService service = removeServiceReferences(name);
if (service != null) {
AxisServiceGroup serviceGroup = service.getAxisServiceGroup();
serviceGroup.removeService(name);
@@ -1221,6 +1210,15 @@ public class AxisConfiguration extends AxisDescription {
if (configurator != null) {
configurator.cleanup();
}
+ this.policySupportedModules.clear();
+ this.moduleConfigmap.clear();
+ this.allEndpoints.clear();
+ this.allModules.clear();
+ this.allServices.clear();
+ this.outPhases.clear();
+ this.messageReceivers.clear();
+ this.targetResolvers.clear();
+ this.configurator = null;
}
/**
@@ -1343,4 +1341,21 @@ public class AxisConfiguration extends AxisDescription {
}
return childFirstClassLoading;
}
+
+ private AxisService removeServiceReferences(String serviceName) {
+
+ AxisService axisService = (AxisService) allServices.remove(serviceName);
+ if (axisService != null) {
+ if (!axisService.isClientSide()) {
+ notifyObservers(AxisEvent.SERVICE_REMOVE, axisService);
+ }
+
+ //removes the endpoints to this service
+ for (Iterator<String> iter = axisService.getEndpoints().keySet().iterator(); iter.hasNext();){
+ String key = serviceName + "." + (String)iter.next();
+ this.allEndpoints.remove(key);
+ }
+ }
+ return axisService;
+ }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment