You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by ff...@apache.org on 2009/02/02 10:24:17 UTC

svn commit: r739949 - /servicemix/smx4/nmr/trunk/jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/Deployer.java

Author: ffang
Date: Mon Feb  2 09:24:16 2009
New Revision: 739949

URL: http://svn.apache.org/viewvc?rev=739949&view=rev
Log:
[SMX4NMR-61] jbi/list output isn't correct after stop and start jbi deployer bundle

Modified:
    servicemix/smx4/nmr/trunk/jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/Deployer.java

Modified: servicemix/smx4/nmr/trunk/jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/Deployer.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/Deployer.java?rev=739949&r1=739948&r2=739949&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/Deployer.java (original)
+++ servicemix/smx4/nmr/trunk/jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/Deployer.java Mon Feb  2 09:24:16 2009
@@ -216,10 +216,11 @@
         pendingBundles.remove(bundle);
         List<ServiceRegistration> registrations = services.remove(bundle);
         if (registrations != null) {
-            for (ServiceRegistration reg : registrations) {
+        	for (ServiceRegistration reg : registrations) {
                 try {
-                    reg.unregister();
+                	reg.unregister();
                 } catch (IllegalStateException e) {
+                	e.printStackTrace();
                     // Ignore
                 }
             }
@@ -448,6 +449,18 @@
                 try {
                     ci.stop(false);
                     ci.shutDown(false, false);
+                    pendingBundles.remove(reference.getBundle());
+                    List<ServiceRegistration> registrations = services.remove(reference.getBundle());
+                    if (registrations != null) {
+                    	for (ServiceRegistration reg : registrations) {
+                            try {
+                            	reg.unregister();
+                            } catch (IllegalStateException e) {
+                            	e.printStackTrace();
+                                // Ignore
+                            }
+                        }
+                    }
                 } catch (JBIException e) {
                     LOGGER.warn("Error when shutting down component", e);
                 }