Bug 296356 We shouldn't create more than one e4 OSGi context per BundleContext
tests/org.eclipse.e4.ui.bindings.tests/src/org/eclipse/e4/ui/bindings/tests/Activator.java
}
		});
	}
	public void stop(BundleContext context) throws Exception {
		if (serviceContext instanceof IDisposable) {
			((IDisposable) serviceContext).dispose();
		}
		plugin = null;
	}
	public IEclipseContext getGlobalContext() {
		return appContext;
	}
	public PackageAdmin getBundleAdmin() {
		return (PackageAdmin) serviceContext.get(PackageAdmin.class.getName());
	}
	public Bundle getBundleForName(String bundleName) {
		Bundle[] bundles = getBundleAdmin().getBundles(bundleName, null);
		if (bundles == null)
			return null;
		
		for (int i = 0; i < bundles.length; i++) {
			if ((bundles[i].getState() & (Bundle.INSTALLED | Bundle.UNINSTALLED)) == 0) {
				return bundles[i];
			}
		}
		return null;
	}
}