cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r640924 - in /incubator/cxf/branches/2.0.x-fixes: ./ rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java
Date Tue, 25 Mar 2008 18:16:22 GMT
Author: dkulp
Date: Tue Mar 25 11:16:19 2008
New Revision: 640924

URL: http://svn.apache.org/viewvc?rev=640924&view=rev
Log:
Merged revisions 640705 via svnmerge from 
https://svn.apache.org/repos/asf/incubator/cxf/trunk

........
  r640705 | bharath | 2008-03-25 01:24:17 -0400 (Tue, 25 Mar 2008) | 1 line
  
  Fix for [JIRA  CXF-1488]
........

Modified:
    incubator/cxf/branches/2.0.x-fixes/   (props changed)
    incubator/cxf/branches/2.0.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java

Propchange: incubator/cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: incubator/cxf/branches/2.0.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java?rev=640924&r1=640923&r2=640924&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java
(original)
+++ incubator/cxf/branches/2.0.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java
Tue Mar 25 11:16:19 2008
@@ -19,12 +19,7 @@
 
 package org.apache.cxf.ws.policy;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
 import java.util.concurrent.ConcurrentHashMap;
 
 import javax.annotation.PostConstruct;
@@ -542,33 +537,55 @@
         // empty
     }
 
+    /**
+     * Callback recieved while the server side endpoint is being undeployed.
+     *
+     * @param server
+     */
     public void stopServer(Server server) {
         EndpointInfo ei = server.getEndpoint().getEndpointInfo();
         serverEndpointInfo.remove(ei);
 
-        cleanupBindingOperations(ei, clientRequestInfo);
-        cleanupBindingOperations(ei, clientResponseInfo);
-
-        cleanupBindingOperations(ei, serverRequestInfo);
-        cleanupBindingOperations(ei, serverResponseInfo);
-
-        cleanupBindingFaults(ei, clientFaultInfo);
-        cleanupBindingFaults(ei, serverFaultInfo);
+        /**
+         * While cleaning up the entries of requestInfo's, responseInfo's and faultInfo's
map, we create a temperory
+         * Set with all the keys. Later we iterate over the keys of this temp set, and if
it's same as that of the
+         * endpoint being undeployed, we remove the corresponding entries from the client
and server maps.
+         */
+
+        cleanupBindingOperations(ei, new HashSet<BindingOperation>(clientRequestInfo.keySet()),
+                clientRequestInfo);
+        cleanupBindingOperations(ei, new HashSet<BindingOperation>(clientResponseInfo.keySet()),
+                clientResponseInfo);
+
+        cleanupBindingOperations(ei, new HashSet<BindingOperation>(serverRequestInfo.keySet()),
+                serverRequestInfo);
+        cleanupBindingOperations(ei, new HashSet<BindingOperation>(serverResponseInfo.keySet()),
+                serverResponseInfo);
+
+        cleanupBindingFaults(ei, new HashSet<BindingFault>(clientFaultInfo.keySet()),
+                clientFaultInfo);
+        cleanupBindingFaults(ei, new HashSet<BindingFault>(serverFaultInfo.keySet()),
+                serverFaultInfo);
     }
 
     private void cleanupBindingOperations(EndpointInfo ei,
+                                          Set<BindingOperation> bindingOperations,
                                           Map<BindingOperation, EffectivePolicy> originalMap)
{
         
-        for (BindingOperation bindingOperation : originalMap.keySet()) {
+        Iterator<BindingOperation> bindingOpsItr = bindingOperations.iterator();
+        while (bindingOpsItr.hasNext()) {
+            BindingOperation bindingOperation = bindingOpsItr.next();
             if (ei.isSameAs(bindingOperation.getEndpoint())) {
                 originalMap.remove(bindingOperation);
             }
         }
     }
 
-    private void cleanupBindingFaults(EndpointInfo ei,
+    private void cleanupBindingFaults(EndpointInfo ei, Set <BindingFault> bindingFaults,
                                       Map<BindingFault, EffectivePolicy> originalMap)
{
-        for (BindingFault bindingFault : originalMap.keySet()) {
+        Iterator<BindingFault> bindingFaultsItr = bindingFaults.iterator();
+        while (bindingFaultsItr.hasNext()) {
+            BindingFault bindingFault = bindingFaultsItr.next();
             if (ei.isSameAs(bindingFault.getEndpoint())) {
                 originalMap.remove(bindingFault);
             }



Mime
View raw message