Skip to content

Commit

Permalink
Open and close the LogService tracker
Browse files Browse the repository at this point in the history
Forgot to open and close the new ServiceTracker I added to the Activator
in the previous commit. local test now looks fine.
  • Loading branch information
bramk committed Jan 31, 2012
1 parent 8d659be commit 71334cc
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ private StorageProvider startUserAdminService(String type, ServiceReference stor
throw new IllegalStateException("Internal error: StorageProvider service implementation not available.");
}
if (!m_services.containsKey(type)) {
logMessage(LogService.LOG_DEBUG, " -- starting new UserAdmin service for provider: " + type);
logMessage(LogService.LOG_INFO, " -- starting new UserAdmin service for provider: " + type);
Dictionary<String, String> properties = new Hashtable<String, String>();
properties.put(Constants.SERVICE_PID, UserAdminConstants.SERVICE_PID + "." + type);
properties.put(UserAdminConstants.STORAGEPROVIDER_TYPE, type);
Expand Down Expand Up @@ -117,6 +117,7 @@ public void start(BundleContext context) throws Exception {
m_logServiceTracker = new ServiceTracker(context,
LogService.class.getName(),
null);
m_logServiceTracker.open();

// install a service tracker to track StorageProvider services and
// configure ourselves as event handler
Expand All @@ -130,6 +131,9 @@ public void start(BundleContext context) throws Exception {
* @see BundleActivator#stop(BundleContext)
*/
public void stop(BundleContext context) throws Exception {
m_logServiceTracker.close();
m_logServiceTracker = null;

m_providerTracker.close();
// unregister all UserAdmin services we created
for (ServiceRegistration registration : m_services.values()) {
Expand Down

0 comments on commit 71334cc

Please sign in to comment.