Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Arthorne2010-02-11 20:47:54 +0000
committerJohn Arthorne2010-02-11 20:47:54 +0000
commit0b8dce7904a64b4d00023cb81494ba3a7f3835f2 (patch)
tree34468e55e1695f8b7c47caf7a2571b76ce7cd240 /bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine
parente1cdfad1c011907b941bbaeb71fd63df0ba0aec7 (diff)
downloadrt.equinox.p2-0b8dce7904a64b4d00023cb81494ba3a7f3835f2.tar.gz
rt.equinox.p2-0b8dce7904a64b4d00023cb81494ba3a7f3835f2.tar.xz
rt.equinox.p2-0b8dce7904a64b4d00023cb81494ba3a7f3835f2.zip
Bug 299987 - Removal of p2 services in favor of always using an agent
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine')
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/EngineActivator.java45
1 files changed, 3 insertions, 42 deletions
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/EngineActivator.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/EngineActivator.java
index 114b2caea..6aa9710ff 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/EngineActivator.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/EngineActivator.java
@@ -10,14 +10,10 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.engine;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.equinox.p2.core.IProvisioningAgent;
-import org.eclipse.equinox.p2.engine.IEngine;
-import org.osgi.framework.*;
-import org.osgi.util.tracker.ServiceTracker;
-import org.osgi.util.tracker.ServiceTrackerCustomizer;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
-public class EngineActivator implements BundleActivator, ServiceTrackerCustomizer {
+public class EngineActivator implements BundleActivator {
private static BundleContext context;
public static final String ID = "org.eclipse.equinox.p2.engine"; //$NON-NLS-1$
@@ -56,50 +52,15 @@ public class EngineActivator implements BundleActivator, ServiceTrackerCustomize
*/
public static final String UNSIGNED_ALLOW = "allow"; //$NON-NLS-1$
- private ServiceRegistration registration;
-
- private ServiceTracker tracker;
-
public static BundleContext getContext() {
return context;
}
- public Object addingService(ServiceReference reference) {
- if (registration == null) {
- //TODO: eventually we shouldn't register a singleton engine automatically
- IProvisioningAgent agent = (IProvisioningAgent) context.getService(reference);
- IEngine engine = (IEngine) agent.getService(IEngine.SERVICE_NAME);
- registration = context.registerService(IEngine.SERVICE_NAME, engine, null);
- return agent;
- }
- return null;
- }
-
- public void modifiedService(ServiceReference reference, Object service) {
- // nothing to do
- }
-
- public void removedService(ServiceReference reference, Object service) {
- if (registration != null) {
- registration.unregister();
- registration = null;
- }
- }
-
public void start(BundleContext aContext) throws Exception {
EngineActivator.context = aContext;
- //only want to register a service for the agent of the currently running system
- String filter = "(&(objectClass=" + IProvisioningAgent.SERVICE_NAME + ")(agent.current=true))"; //$NON-NLS-1$ //$NON-NLS-2$
- tracker = new ServiceTracker(context, aContext.createFilter(filter), this);
- tracker.open();
}
public void stop(BundleContext aContext) throws Exception {
- tracker.close();
- tracker = null;
- //ensure there are no more profile preference save jobs running
- Job.getJobManager().join(ProfilePreferences.PROFILE_SAVE_JOB_FAMILY, null);
-
EngineActivator.context = null;
}

Back to the top