cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1232401 - in /cxf/dosgi/trunk/dsw: cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/ cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/ cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/
Date Tue, 17 Jan 2012 12:57:57 GMT
Author: sergeyb
Date: Tue Jan 17 12:57:56 2012
New Revision: 1232401

URL: http://svn.apache.org/viewvc?rev=1232401&view=rev
Log:
Removing the redundant list from the admin instance

Modified:
    cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/ExportRegistrationImpl.java
    cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/RemoteServiceAdminInstance.java
    cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/RemoteServiceAdminList.java
    cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/TopologyManager.java
    cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/TopologyManagerImport.java
    cxf/dosgi/trunk/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/RemoteServiceAdminListTest.java
    cxf/dosgi/trunk/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/TopologyManagerImportTest.java

Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/ExportRegistrationImpl.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/ExportRegistrationImpl.java?rev=1232401&r1=1232400&r2=1232401&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/ExportRegistrationImpl.java
(original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/ExportRegistrationImpl.java
Tue Jan 17 12:57:56 2012
@@ -159,11 +159,6 @@ public class ExportRegistrationImpl impl
                 r += entry.getKey() + "  => " + entry.getValue() + "\n";
             }
         }
-        r += "\n";
-        r += "*** Exception: " + exception + " **** \n";
-        r += "*** isClosed : " + closed + " ****\n";
-        r += "\n";
-
         return r;
     }
 
@@ -221,7 +216,7 @@ public class ExportRegistrationImpl impl
         serviceTracker = new ServiceTracker(bctx, f, new ServiceTrackerCustomizer() {
             
             public void removedService(ServiceReference sr, Object s) {
-                LOG.info("Service ["+sid+"] has ben unregistered: Removing service export");
+                LOG.info("Service ["+sid+"] has been unregistered: Removing service export");
                 close();
             }
             

Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/RemoteServiceAdminInstance.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/RemoteServiceAdminInstance.java?rev=1232401&r1=1232400&r2=1232401&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/RemoteServiceAdminInstance.java
(original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/RemoteServiceAdminInstance.java
Tue Jan 17 12:57:56 2012
@@ -33,7 +33,6 @@ import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
 import org.osgi.service.remoteserviceadmin.EndpointDescription;
 import org.osgi.service.remoteserviceadmin.EndpointPermission;
-import org.osgi.service.remoteserviceadmin.ExportRegistration;
 import org.osgi.service.remoteserviceadmin.ImportRegistration;
 import org.osgi.service.remoteserviceadmin.RemoteServiceAdmin;
 
@@ -46,8 +45,7 @@ public class RemoteServiceAdminInstance 
     private boolean closed = false;
 
     private List<ImportRegistration> importedServices = new ArrayList<ImportRegistration>();
-    private List<ExportRegistration> exportedServices = new ArrayList<ExportRegistration>();
-
+    
     public RemoteServiceAdminInstance(BundleContext bc, RemoteServiceAdminCore core) {
         bctx = bc;
         rsaCore = core;
@@ -74,12 +72,7 @@ public class RemoteServiceAdminInstance 
                 if (closed)
                     return Collections.EMPTY_LIST;
 
-                synchronized (exportedServices) {
-                    List er = rsaCore.exportService(refFinal, propertiesFinal);
-                    if (er != null)
-                        exportedServices.addAll(er);
-                    return er;
-                }
+                 return rsaCore.exportService(refFinal, propertiesFinal);
             }
         });
     }
@@ -147,13 +140,6 @@ public class RemoteServiceAdminInstance 
                 ir.close();
             }
         }
-        synchronized (exportedServices) {
-            LOG.info("Removing all services exported by this RSA instance");
-            for (ExportRegistration er : exportedServices) {
-                LOG.finest("Closing ExportRegistration " + er);
-                er.close();
-            }
-        }
     }
 
 }

Modified: cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/RemoteServiceAdminList.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/RemoteServiceAdminList.java?rev=1232401&r1=1232400&r2=1232401&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/RemoteServiceAdminList.java
(original)
+++ cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/RemoteServiceAdminList.java
Tue Jan 17 12:57:56 2012
@@ -52,7 +52,7 @@ public class RemoteServiceAdminList exte
                 }
                 LOG.info("enlisted RemoteEventAdmins: " + this.size());
 
-                triggerExportImportForRemoteSericeAdmin(rsa);
+                triggerExportImportForRemoteServiceAdmin(rsa);
 
                 return super.addingService(reference);
             }
@@ -84,9 +84,9 @@ public class RemoteServiceAdminList exte
     }
 
 
-    protected void triggerExportImportForRemoteSericeAdmin(RemoteServiceAdmin rsa) {
-        topManager.triggerExportImportForRemoteSericeAdmin(rsa);
-        topManagerImport.triggerExportImportForRemoteSericeAdmin(rsa);
+    protected void triggerExportImportForRemoteServiceAdmin(RemoteServiceAdmin rsa) {
+        topManager.triggerExportImportForRemoteServiceAdmin(rsa);
+        topManagerImport.triggerExportImportForRemoteServiceAdmin(rsa);
     }
 
 

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=1232401&r1=1232400&r2=1232401&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
Tue Jan 17 12:57:56 2012
@@ -77,10 +77,11 @@ public class TopologyManager {
      * 
      * </pre>
      */
-    private final HashMap<ServiceReference, HashMap<RemoteServiceAdmin, Collection<ExportRegistration>>>
exportedServices = new LinkedHashMap<ServiceReference, HashMap<RemoteServiceAdmin, Collection<ExportRegistration>>>();
+    private final Map<ServiceReference, 
+                      Map<RemoteServiceAdmin, Collection<ExportRegistration>>>
exportedServices = 
+        new LinkedHashMap<ServiceReference, Map<RemoteServiceAdmin, Collection<ExportRegistration>>>();
 
     private BundleContext bctx;
-    // private List<RemoteServiceAdmin> remoteServiceAdmins = new ArrayList<RemoteServiceAdmin>();
 
     private ServiceTracker stEndpointListeners;
 
@@ -109,7 +110,7 @@ public class TopologyManager {
 
             private void notify(ServiceReference reference) {
                 synchronized (exportedServices) {
-                    for (HashMap<RemoteServiceAdmin, Collection<ExportRegistration>>
exports : exportedServices
+                    for (Map<RemoteServiceAdmin, Collection<ExportRegistration>>
exports : exportedServices
                         .values()) {
                         for (Collection<ExportRegistration> regs : exports.values())
{
                             if (regs != null)
@@ -126,7 +127,7 @@ public class TopologyManager {
 
     protected void removeRemoteServiceAdmin(RemoteServiceAdmin rsa) {
         synchronized (exportedServices) {
-            for (Map.Entry<ServiceReference, HashMap<RemoteServiceAdmin, Collection<ExportRegistration>>>
exports : exportedServices
+            for (Map.Entry<ServiceReference, Map<RemoteServiceAdmin, Collection<ExportRegistration>>>
exports : exportedServices
                 .entrySet()) {
                 if (exports.getValue().containsKey(rsa)) {
                     // service was handled by this RemoteServiceAdmin
@@ -149,11 +150,11 @@ public class TopologyManager {
         }
     }
 
-    protected void triggerExportImportForRemoteSericeAdmin(RemoteServiceAdmin rsa) {
+    protected void triggerExportImportForRemoteServiceAdmin(RemoteServiceAdmin rsa) {
         LOG.info("TopologyManager: triggerExportImportForRemoteSericeAdmin()");
 
         synchronized (exportedServices) {
-            for (Map.Entry<ServiceReference, HashMap<RemoteServiceAdmin, Collection<ExportRegistration>>>
exports : exportedServices
+            for (Map.Entry<ServiceReference, Map<RemoteServiceAdmin, Collection<ExportRegistration>>>
exports : exportedServices
                 .entrySet()) {
                 if (exports.getValue().containsKey(rsa)) {
                     // already handled....
@@ -408,7 +409,7 @@ public class TopologyManager {
         if (sref != null) {
             synchronized (exportedServices) {
 
-                HashMap<RemoteServiceAdmin, Collection<ExportRegistration>> ex
= exportedServices.get(sref);
+                Map<RemoteServiceAdmin, Collection<ExportRegistration>> ex =
exportedServices.get(sref);
                 if (ex != null) {
                     EndpointDescription ep = exportRegistration.getExportReference().getExportedEndpoint();
                     for (Map.Entry<RemoteServiceAdmin, Collection<ExportRegistration>>
export : ex.entrySet()) {

Modified: cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/TopologyManagerImport.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/TopologyManagerImport.java?rev=1232401&r1=1232400&r2=1232401&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/TopologyManagerImport.java
(original)
+++ cxf/dosgi/trunk/dsw/cxf-topology-manager/src/main/java/org/apache/cxf/dosgi/topologymanager/TopologyManagerImport.java
Tue Jan 17 12:57:56 2012
@@ -339,7 +339,7 @@ public class TopologyManagerImport {
         }
     }
 
-    public void triggerExportImportForRemoteSericeAdmin(RemoteServiceAdmin rsa) {
+    public void triggerExportImportForRemoteServiceAdmin(RemoteServiceAdmin rsa) {
         LOG.fine("New RSA detected trying to import services with it");
         synchronized (importPossibilities) {
             Set<Map.Entry<String, List<EndpointDescription>>> entries =
importPossibilities.entrySet();

Modified: cxf/dosgi/trunk/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/RemoteServiceAdminListTest.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/RemoteServiceAdminListTest.java?rev=1232401&r1=1232400&r2=1232401&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/RemoteServiceAdminListTest.java
(original)
+++ cxf/dosgi/trunk/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/RemoteServiceAdminListTest.java
Tue Jan 17 12:57:56 2012
@@ -53,10 +53,10 @@ public class RemoteServiceAdminListTest 
         tm.removeRemoteServiceAdmin(EasyMock.eq(rsa));
         EasyMock.expectLastCall().once();
         
-        tm.triggerExportImportForRemoteSericeAdmin(EasyMock.eq(rsa));
+        tm.triggerExportImportForRemoteServiceAdmin(EasyMock.eq(rsa));
         EasyMock.expectLastCall().once();
         
-        tmi.triggerExportImportForRemoteSericeAdmin(EasyMock.eq(rsa));
+        tmi.triggerExportImportForRemoteServiceAdmin(EasyMock.eq(rsa));
         EasyMock.expectLastCall().once();
         
         bc.addServiceListener((ServiceListener)EasyMock.anyObject(),(String)EasyMock.anyObject());


Modified: cxf/dosgi/trunk/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/TopologyManagerImportTest.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/TopologyManagerImportTest.java?rev=1232401&r1=1232400&r2=1232401&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/TopologyManagerImportTest.java
(original)
+++ cxf/dosgi/trunk/dsw/cxf-topology-manager/src/test/java/org/apache/cxf/dosgi/topologymanager/TopologyManagerImportTest.java
Tue Jan 17 12:57:56 2012
@@ -62,7 +62,7 @@ public class TopologyManagerImportTest {
         
         rsaList.add(rsa);
         
-        tm.triggerExportImportForRemoteSericeAdmin(rsa);
+        tm.triggerExportImportForRemoteServiceAdmin(rsa);
         
         assertTrue(sema.tryAcquire(10, TimeUnit.SECONDS));
         



Mime
View raw message