You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by gn...@apache.org on 2008/07/24 18:01:37 UTC
svn commit: r679440 -
/servicemix/smx4/specs/trunk/locator/src/main/java/org/apache/servicemix/specs/locator/Activator.java
Author: gnodet
Date: Thu Jul 24 09:01:36 2008
New Revision: 679440
URL: http://svn.apache.org/viewvc?rev=679440&view=rev
Log:
SM-1438: NPE in the specs when uninstalling bundle
Modified:
servicemix/smx4/specs/trunk/locator/src/main/java/org/apache/servicemix/specs/locator/Activator.java
Modified: servicemix/smx4/specs/trunk/locator/src/main/java/org/apache/servicemix/specs/locator/Activator.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/specs/trunk/locator/src/main/java/org/apache/servicemix/specs/locator/Activator.java?rev=679440&r1=679439&r2=679440&view=diff
==============================================================================
--- servicemix/smx4/specs/trunk/locator/src/main/java/org/apache/servicemix/specs/locator/Activator.java (original)
+++ servicemix/smx4/specs/trunk/locator/src/main/java/org/apache/servicemix/specs/locator/Activator.java Thu Jul 24 09:01:36 2008
@@ -47,7 +47,7 @@
public synchronized void stop(BundleContext bundleContext) throws Exception {
while (!factories.isEmpty()) {
- unregister(bundleContext.getBundle(factories.keySet().iterator().next()));
+ unregister(factories.keySet().iterator().next());
}
this.bundleContext = null;
}
@@ -56,7 +56,7 @@
if (event.getType() == BundleEvent.RESOLVED) {
register(event.getBundle());
} else if (event.getType() == BundleEvent.UNRESOLVED) {
- unregister(event.getBundle());
+ unregister(event.getBundle().getBundleId());
}
}
@@ -92,8 +92,8 @@
}
}
- protected void unregister(Bundle bundle) {
- Map<String, Callable<Class>> map = factories.remove(bundle.getBundleId());
+ protected void unregister(long bundleId) {
+ Map<String, Callable<Class>> map = factories.remove(bundleId);
if (map != null) {
for (Map.Entry<String, Callable<Class>> entry : map.entrySet()) {
OsgiLocator.unregister(entry.getKey(), entry.getValue());