Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Arthorne2010-02-15 04:11:23 +0000
committerJohn Arthorne2010-02-15 04:11:23 +0000
commit1bedd453542f0c8171ad816e02276d13f0b5c47d (patch)
treed45425a83bdefd96dc6bcdd5d3e9b0da96c10c7c /bundles/org.eclipse.equinox.p2.reconciler.dropins/src
parent8051305f54fdc87ee41ea38a287c3acf686150f6 (diff)
downloadrt.equinox.p2-1bedd453542f0c8171ad816e02276d13f0b5c47d.tar.gz
rt.equinox.p2-1bedd453542f0c8171ad816e02276d13f0b5c47d.tar.xz
rt.equinox.p2-1bedd453542f0c8171ad816e02276d13f0b5c47d.zip
Bug 225250 - Need to get rid of exemplary setup
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.reconciler.dropins/src')
-rw-r--r--bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/Activator.java43
1 files changed, 2 insertions, 41 deletions
diff --git a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/Activator.java b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/Activator.java
index a47bd5530..d182d0b0e 100644
--- a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/Activator.java
+++ b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/Activator.java
@@ -31,8 +31,8 @@ import org.eclipse.equinox.p2.repository.artifact.IArtifactRepositoryManager;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
import org.eclipse.osgi.service.datalocation.Location;
-import org.osgi.framework.*;
-import org.osgi.service.packageadmin.PackageAdmin;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
public class Activator implements BundleActivator {
@@ -48,9 +48,7 @@ public class Activator implements BundleActivator {
private static final String DIR_PLUGINS = "plugins"; //$NON-NLS-1$
private static final String DIR_FEATURES = "features"; //$NON-NLS-1$
private static final String EXT_LINK = ".link"; //$NON-NLS-1$
- private static PackageAdmin packageAdmin;
private static BundleContext bundleContext;
- private ServiceReference packageAdminRef;
private final static Set<IMetadataRepository> repositories = new HashSet<IMetadataRepository>();
private Collection<File> filesToCheck = null;
@@ -146,8 +144,6 @@ public class Activator implements BundleActivator {
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
- packageAdminRef = context.getServiceReference(PackageAdmin.class.getName());
- setPackageAdmin((PackageAdmin) context.getService(packageAdminRef));
bundleContext = context;
// check to see if there is really any work to do. Do this after setting the context, and
@@ -158,9 +154,6 @@ public class Activator implements BundleActivator {
return;
}
- if (!startEarly("org.eclipse.equinox.p2.exemplarysetup")) //$NON-NLS-1$
- return;
-
checkConfigIni();
// create the watcher for the "drop-ins" folder
@@ -402,14 +395,6 @@ public class Activator implements BundleActivator {
}
}
- private boolean startEarly(String bundleName) throws BundleException {
- Bundle bundle = getBundle(bundleName);
- if (bundle == null)
- return false;
- bundle.start(Bundle.START_TRANSIENT);
- return true;
- }
-
/*
* Synchronize the profile.
*/
@@ -497,8 +482,6 @@ public class Activator implements BundleActivator {
*/
public void stop(BundleContext context) throws Exception {
bundleContext = null;
- setPackageAdmin(null);
- context.ungetService(packageAdminRef);
}
/*
@@ -627,26 +610,4 @@ public class Activator implements BundleActivator {
return null;
return profileRegistry.getProfile(IProfileRegistry.SELF);
}
-
- private static synchronized void setPackageAdmin(PackageAdmin service) {
- packageAdmin = service;
- }
-
- /*
- * Return the bundle with the given symbolic name, or null if it cannot be found.
- */
- static synchronized Bundle getBundle(String symbolicName) {
- if (packageAdmin == null)
- return null;
- Bundle[] bundles = packageAdmin.getBundles(symbolicName, null);
- if (bundles == null)
- return null;
- //Return the first bundle that is not installed or uninstalled
- for (int i = 0; i < bundles.length; i++) {
- if ((bundles[i].getState() & (Bundle.INSTALLED | Bundle.UNINSTALLED)) == 0) {
- return bundles[i];
- }
- }
- return null;
- }
}

Back to the top