tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rf...@apache.org
Subject svn commit: r831102 - in /tuscany/java/sca/modules: extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/ implementation-osgi-runtime/src/main/java/org/apache/tuscany/sca/implementation/osgi/runtime/ node-impl-osgi/src/main/...
Date Thu, 29 Oct 2009 21:44:11 GMT
Author: rfeng
Date: Thu Oct 29 21:44:11 2009
New Revision: 831102

URL: http://svn.apache.org/viewvc?rev=831102&view=rev
Log:
Ignore IllegalStateException for service unregister()

Modified:
    tuscany/java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/OSGiExtensionPointRegistry.java
    tuscany/java/sca/modules/implementation-osgi-runtime/src/main/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiImplementationProvider.java
    tuscany/java/sca/modules/implementation-osgi-runtime/src/main/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiImplementationRuntimeActivator.java
    tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/node/osgi/impl/OSGiNodeFactoryImpl.java
    tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/RemoteServiceAdminImpl.java
    tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/TopologyManagerImpl.java
    tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/discovery/impl/DiscoveryActivator.java

Modified: tuscany/java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/OSGiExtensionPointRegistry.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/OSGiExtensionPointRegistry.java?rev=831102&r1=831101&r2=831102&view=diff
==============================================================================
--- tuscany/java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/OSGiExtensionPointRegistry.java
(original)
+++ tuscany/java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/OSGiExtensionPointRegistry.java
Thu Oct 29 21:44:11 2009
@@ -78,7 +78,11 @@
     protected void unregisterExtensionPoint(Class<?> i) {
         ServiceRegistration registration = registrations.remove(i);
         if (registration != null) {
-            registration.unregister();
+            try {
+                registration.unregister();
+            } catch (IllegalStateException e) {
+                // The service has been unregistered, ignore it
+            }        
         }
         super.unregisterExtensionPoint(i);
     }

Modified: tuscany/java/sca/modules/implementation-osgi-runtime/src/main/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiImplementationProvider.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-osgi-runtime/src/main/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiImplementationProvider.java?rev=831102&r1=831101&r2=831102&view=diff
==============================================================================
--- tuscany/java/sca/modules/implementation-osgi-runtime/src/main/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiImplementationProvider.java
(original)
+++ tuscany/java/sca/modules/implementation-osgi-runtime/src/main/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiImplementationProvider.java
Thu Oct 29 21:44:11 2009
@@ -130,8 +130,7 @@
             try {
                 registration.unregister();
             } catch (IllegalStateException e) {
-                // The service has been unregistered
-                // Ignore
+                // The service has been unregistered, ignore it
             }
         }
         registrations.clear();

Modified: tuscany/java/sca/modules/implementation-osgi-runtime/src/main/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiImplementationRuntimeActivator.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-osgi-runtime/src/main/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiImplementationRuntimeActivator.java?rev=831102&r1=831101&r2=831102&view=diff
==============================================================================
--- tuscany/java/sca/modules/implementation-osgi-runtime/src/main/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiImplementationRuntimeActivator.java
(original)
+++ tuscany/java/sca/modules/implementation-osgi-runtime/src/main/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiImplementationRuntimeActivator.java
Thu Oct 29 21:44:11 2009
@@ -39,7 +39,11 @@
 
     public void stop(BundleContext context) throws Exception {
         if (distributionProvider != null) {
-            distributionProvider.unregister();
+            try {
+                distributionProvider.unregister();
+            } catch (IllegalStateException e) {
+                // The service has been unregistered, ignore it
+            }        
         }
         bundleContext = null;
     }

Modified: tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/node/osgi/impl/OSGiNodeFactoryImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/node/osgi/impl/OSGiNodeFactoryImpl.java?rev=831102&r1=831101&r2=831102&view=diff
==============================================================================
--- tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/node/osgi/impl/OSGiNodeFactoryImpl.java
(original)
+++ tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/node/osgi/impl/OSGiNodeFactoryImpl.java
Thu Oct 29 21:44:11 2009
@@ -111,7 +111,11 @@
     public synchronized void destroy() {
         if (inited) {
             if (registration != null) {
-                registration.unregister();
+                try {
+                    registration.unregister();
+                } catch (IllegalStateException e) {
+                    // The service has been unregistered, ignore it
+                }
                 registration = null;
             }
             super.destroy();

Modified: tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/RemoteServiceAdminImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/RemoteServiceAdminImpl.java?rev=831102&r1=831101&r2=831102&view=diff
==============================================================================
--- tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/RemoteServiceAdminImpl.java
(original)
+++ tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/RemoteServiceAdminImpl.java
Thu Oct 29 21:44:11 2009
@@ -78,11 +78,19 @@
 
     public void stop() {
         if (registration != null) {
-            registration.unregister();
+            try {
+                registration.unregister();
+            } catch (IllegalStateException e) {
+                // The service has been unregistered, ignore it
+            }
             registration = null;
         }
         if (managedService != null) {
-            managedService.unregister();
+            try {
+                managedService.unregister();
+            } catch (IllegalStateException e) {
+                // The service has been unregistered, ignore it
+            }
             managedService = null;
         }
         if (listeners != null) {

Modified: tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/TopologyManagerImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/TopologyManagerImpl.java?rev=831102&r1=831101&r2=831102&view=diff
==============================================================================
--- tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/TopologyManagerImpl.java
(original)
+++ tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/TopologyManagerImpl.java
Thu Oct 29 21:44:11 2009
@@ -374,7 +374,11 @@
         remotableServices.close();
 
         if (registration != null) {
-            registration.unregister();
+            try {
+                registration.unregister();
+            } catch (IllegalStateException e) {
+                // The service has been unregistered, ignore it
+            }
             registration = null;
         }
         if (remoteAdmins != null) {

Modified: tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/discovery/impl/DiscoveryActivator.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/discovery/impl/DiscoveryActivator.java?rev=831102&r1=831101&r2=831102&view=diff
==============================================================================
--- tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/discovery/impl/DiscoveryActivator.java
(original)
+++ tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/discovery/impl/DiscoveryActivator.java
Thu Oct 29 21:44:11 2009
@@ -44,7 +44,11 @@
 
     public void stop(BundleContext context) {
         for (ServiceRegistration registration : discoveryServiceRegistrations) {
-            registration.unregister();
+            try {
+                registration.unregister();
+            } catch (IllegalStateException e) {
+                // The service has been unregistered, ignore it
+            }        
         }
         for (AbstractDiscoveryService service : discoveryServices) {
             service.stop();



Mime
View raw message