cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1221933 - /cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/TopologyManager.java
Date Wed, 21 Dec 2011 23:07:39 GMT
Author: sergeyb
Date: Wed Dec 21 23:07:38 2011
New Revision: 1221933

URL: http://svn.apache.org/viewvc?rev=1221933&view=rev
Log:
[DOSGI-76] Applying a patch on behalf of Marco Mauri

Modified:
    cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/TopologyManager.java

Modified: cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/TopologyManager.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/TopologyManager.java?rev=1221933&r1=1221932&r2=1221933&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/TopologyManager.java
(original)
+++ cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/TopologyManager.java
Wed Dec 21 23:07:38 2011
@@ -18,7 +18,6 @@
  */
 package org.apache.cxf.dosgi.topologymanager;
 
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Dictionary;
@@ -42,7 +41,6 @@ import org.osgi.service.remoteserviceadm
 import org.osgi.service.remoteserviceadmin.EndpointListener;
 import org.osgi.service.remoteserviceadmin.ExportReference;
 import org.osgi.service.remoteserviceadmin.ExportRegistration;
-import org.osgi.service.remoteserviceadmin.ImportRegistration;
 import org.osgi.service.remoteserviceadmin.RemoteConstants;
 import org.osgi.service.remoteserviceadmin.RemoteServiceAdmin;
 import org.osgi.util.tracker.ServiceTracker;
@@ -198,9 +196,12 @@ public class TopologyManager {
                 Map<RemoteServiceAdmin, Collection<ExportRegistration>> rsas
= exportedServices.get(sref);
                 for (Map.Entry<RemoteServiceAdmin, Collection<ExportRegistration>>
entry : rsas.entrySet()) {
                     if (entry.getValue() != null) {
-                        for (ExportRegistration exReg : entry.getValue()) {
-                            if (exReg != null)
-                                exReg.close();
+                    	Collection<ExportRegistration> registrations = entry.getValue();
+                        notifyListenersOfRemovalIfAppropriate(registrations);
+                        for (ExportRegistration exReg : registrations) {
+                            if (exReg != null) {
+                                 exReg.close();
+                            }
                         }
                     }
                 }
@@ -210,6 +211,12 @@ public class TopologyManager {
         }
     }
 
+    private void notifyListenersOfRemovalIfAppropriate(Collection<ExportRegistration>
registrations) {
+    	for (ServiceReference endpointReference : stEndpointListeners.getServiceReferences())
{
+    	    notifyListenersOfRemovalIfAppropriate(endpointReference, registrations);
+    	}
+    }
+    
     protected void exportService(ServiceReference sref) {
 
         // add to local list of services that should/are be exported



Mime
View raw message