Skip to content

Commit

Permalink
fixed bundle stop and removal
Browse files Browse the repository at this point in the history
Signed-off-by: Juergen Albert <j.albert@data-in-motion.biz>
  • Loading branch information
juergen-albert committed Jan 15, 2024
1 parent e02f60d commit 9e7dfe5
Showing 1 changed file with 4 additions and 5 deletions.
Expand Up @@ -39,7 +39,7 @@ public class Activator implements BundleActivator {
final Map<Bundle, ServiceRegistration<?>> registrations = new ConcurrentHashMap<>();


private BundleTracker tracker;
private BundleTracker<Bundle> tracker;

/*
* (non-Javadoc)
Expand Down Expand Up @@ -120,11 +120,10 @@ public void modifiedBundle(Bundle bundle, BundleEvent event, Bundle object) {

@Override
public void removedBundle(Bundle bundle, BundleEvent event, Bundle object) {
ServiceRegistration<?> registration = registrations.remove(bundle);
if(registration != null) {
registration.unregister();
}
// Services will be removed automatrically
registrations.remove(bundle);
}

});

tracker.open();
Expand Down

0 comments on commit 9e7dfe5

Please sign in to comment.