Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjfogell2006-02-14 22:30:48 +0000
committerjfogell2006-02-14 22:30:48 +0000
commita320f591b92e6406cdc96e8090444f6a911a9308 (patch)
tree3462b965e7bc3038c67b6a3d4037c6c5d2bf1522
parent4ce0f85f01576b6adc3158691845d37944a0d1e7 (diff)
downloadrt.equinox.bundles-a320f591b92e6406cdc96e8090444f6a911a9308.tar.gz
rt.equinox.bundles-a320f591b92e6406cdc96e8090444f6a911a9308.tar.xz
rt.equinox.bundles-a320f591b92e6406cdc96e8090444f6a911a9308.zip
fix for NPE - created unregisterUserAdminService methodv20060214
-rw-r--r--bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/Activator.java49
1 files changed, 27 insertions, 22 deletions
diff --git a/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/Activator.java b/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/Activator.java
index 5df8fab2a..487e21451 100644
--- a/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/Activator.java
+++ b/bundles/org.eclipse.equinox.useradmin/src/org/eclipse/equinox/useradmin/Activator.java
@@ -51,29 +51,9 @@ public class Activator implements BundleActivator, ServiceFactory, ServiceTracke
*/
public void stop(BundleContext context_) throws Exception {
prefsTracker.close();
- if(registration != null)
- {
- registration.unregister();
- registration = null;
- userAdmin.destroy();
- userAdmin = null;
- }
+ unregisterUserAdminService();
}
- /**
- * Register the UserAdmin service.
- */
- protected void registerUserAdminService() throws Exception {
- Hashtable properties = new Hashtable(7);
-
- properties.put(Constants.SERVICE_VENDOR, UserAdminMsg.Service_Vendor);
- properties.put(Constants.SERVICE_DESCRIPTION, UserAdminMsg.OSGi_User_Admin_service_IBM_Implementation_3);
- properties.put(Constants.SERVICE_PID, getClass().getName());
-
- userAdmin = new UserAdmin(prefs, context);
- registration = context.registerService(userAdminClazz, this, properties);
- userAdmin.setServiceReference(registration.getReference());
- }
public Object getService(Bundle bundle, ServiceRegistration registration_) {
userAdmin.setServiceReference(registration_.getReference());
@@ -105,7 +85,32 @@ public class Activator implements BundleActivator, ServiceFactory, ServiceTracke
if (service == prefs) {
prefs = null;
}
- registration.unregister();
+ unregisterUserAdminService();
}
+
+ /**
+ * Register the UserAdmin service.
+ */
+ protected void registerUserAdminService() throws Exception {
+ Hashtable properties = new Hashtable(7);
+
+ properties.put(Constants.SERVICE_VENDOR, UserAdminMsg.Service_Vendor);
+ properties.put(Constants.SERVICE_DESCRIPTION, UserAdminMsg.OSGi_User_Admin_service_IBM_Implementation_3);
+ properties.put(Constants.SERVICE_PID, getClass().getName());
+
+ userAdmin = new UserAdmin(prefs, context);
+ registration = context.registerService(userAdminClazz, this, properties);
+ userAdmin.setServiceReference(registration.getReference());
+ }
+
+ protected void unregisterUserAdminService() {
+ if(registration != null)
+ {
+ registration.unregister();
+ registration = null;
+ userAdmin.destroy();
+ userAdmin = null;
+ }
+ }
}

Back to the top