Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2007-03-16 19:58:54 +0000
committerThomas Watson2007-03-16 19:58:54 +0000
commit8689f1043d9fdd08a2719a8f8de6aaad0d65f048 (patch)
tree58759723225bd583c1f6ab6a105ed973b0bb8aad
parenta8ce18a3c8cdd8e56f7756f03769994bfd8c1a90 (diff)
downloadrt.equinox.framework-8689f1043d9fdd08a2719a8f8de6aaad0d65f048.tar.gz
rt.equinox.framework-8689f1043d9fdd08a2719a8f8de6aaad0d65f048.tar.xz
rt.equinox.framework-8689f1043d9fdd08a2719a8f8de6aaad0d65f048.zip
Bug 172969 Allow EclipseStarter to make the system BundleContext available (patch included)
-rw-r--r--bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/adaptor/EclipseStarter.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/adaptor/EclipseStarter.java b/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/adaptor/EclipseStarter.java
index e4a701c27..0a884a575 100644
--- a/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/adaptor/EclipseStarter.java
+++ b/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/adaptor/EclipseStarter.java
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Alex Blewitt (bug 172969)
*******************************************************************************/
package org.eclipse.core.runtime.adaptor;
@@ -1506,4 +1507,18 @@ public class EclipseStarter {
FrameworkProperties.clearProperty((String) entry.getKey());
}
}
+
+ /**
+ * Returns the context of the system bundle. A value of
+ * <code>null</code> is returned if the platform is not running.
+ * @return the context of the system bundle
+ * @throws java.lang.SecurityException If the caller does not have the
+ * appropriate <code>AdminPermission[system.bundle,CONTEXT]</code>, and
+ * the Java Runtime Environment supports permissions.
+ */
+ public static BundleContext getSystemBundleContext() {
+ if (context == null || !running)
+ return null;
+ return context.getBundle().getBundleContext();
+ }
}

Back to the top