Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDJ Houghton2006-04-18 01:05:25 +0000
committerDJ Houghton2006-04-18 01:05:25 +0000
commitaecfc9145739a4251f26d295039a29c121c006ba (patch)
tree94853bf41b9ae265fc216bd85de233221bcb8b2d /bundles/org.eclipse.equinox.preferences/src/org/eclipse/core/internal/preferences/Activator.java
parent9df93b726839752c24c29018c7b676bc69ad7585 (diff)
downloadrt.equinox.bundles-aecfc9145739a4251f26d295039a29c121c006ba.tar.gz
rt.equinox.bundles-aecfc9145739a4251f26d295039a29c121c006ba.tar.xz
rt.equinox.bundles-aecfc9145739a4251f26d295039a29c121c006ba.zip
Bug 127793 - Improve Headless startup performance (osgi and core runtime side)v20060418
Diffstat (limited to 'bundles/org.eclipse.equinox.preferences/src/org/eclipse/core/internal/preferences/Activator.java')
-rw-r--r--bundles/org.eclipse.equinox.preferences/src/org/eclipse/core/internal/preferences/Activator.java16
1 files changed, 13 insertions, 3 deletions
diff --git a/bundles/org.eclipse.equinox.preferences/src/org/eclipse/core/internal/preferences/Activator.java b/bundles/org.eclipse.equinox.preferences/src/org/eclipse/core/internal/preferences/Activator.java
index 4e9c54154..88df616b9 100644
--- a/bundles/org.eclipse.equinox.preferences/src/org/eclipse/core/internal/preferences/Activator.java
+++ b/bundles/org.eclipse.equinox.preferences/src/org/eclipse/core/internal/preferences/Activator.java
@@ -28,6 +28,12 @@ public class Activator implements BundleActivator, ServiceTrackerCustomizer {
public static final String PI_PREFERENCES = "org.eclipse.equinox.preferences"; //$NON-NLS-1$
/**
+ * Eclipse property. Set to <code>false</code> to avoid registering JobManager
+ * as an OSGi service.
+ */
+ private static final String PROP_REGISTER_PERF_SERVICE = "eclipse.service.pref"; //$NON-NLS-1$
+
+ /**
* Track the registry service - only register preference service if the registry is
* available
*/
@@ -46,7 +52,7 @@ public class Activator implements BundleActivator, ServiceTrackerCustomizer {
/**
* This plugin provides the OSGi Preferences service.
*/
- private ServiceRegistration osgiPreferencesService;
+ private ServiceRegistration osgiPreferencesService = null;
/* (non-Javadoc)
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
@@ -55,8 +61,12 @@ public class Activator implements BundleActivator, ServiceTrackerCustomizer {
bundleContext = context;
processCommandLine();
PreferencesOSGiUtils.getDefault().openServices();
- preferencesService = bundleContext.registerService(IPreferencesService.class.getName(), PreferencesService.getDefault(), new Hashtable());
- osgiPreferencesService = bundleContext.registerService(org.osgi.service.prefs.PreferencesService.class.getName(), new OSGiPreferencesServiceManager(bundleContext), null);
+
+ boolean shouldRegister = !"false".equalsIgnoreCase(context.getProperty(PROP_REGISTER_PERF_SERVICE)); //$NON-NLS-1$
+ if (shouldRegister) {
+ preferencesService = bundleContext.registerService(IPreferencesService.class.getName(), PreferencesService.getDefault(), new Hashtable());
+ osgiPreferencesService = bundleContext.registerService(org.osgi.service.prefs.PreferencesService.class.getName(), new OSGiPreferencesServiceManager(bundleContext), null);
+ }
// use the string for the class name here in case the registry isn't around
registryServiceTracker = new ServiceTracker(bundleContext, "org.eclipse.core.runtime.IExtensionRegistry", this); //$NON-NLS-1$
registryServiceTracker.open();

Back to the top