[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[equinox-dev] Luna - programmatically alter bundle classpath

Hi all,

For the Acceleo project, we dynamically deploy workspace projects into the current Eclipse instance as bundles. To this end, we use a number of the facilities provides within the osgi bundles (PackageAdmin and the likes). This has worked fine for a number of releases, but the reactorings introduces by Luna changed that.

Basically, the framework provides all necessary API to install and uninstall workspace-defined bundles in the running instance... but no API to change said bundles so that they are _valid_ equinox bundles. The workspace projects contain java source code. The compiled classes are located in the project's output directory (bin by default)... But equinox does not know that, so before installing the bundle we need to change its classpath so that equinox can be taught where to look for packages and classes.

Three years ago, I asked for the opening of an API to do just that without relying on restricted classes through https://bugs.eclipse.org/bugs/show_bug.cgi?id=271761 . Really, only these two lines were causing an issue :
	BaseData bundleData = (BaseData)((AbstractBundle)bundle).getBundleData();
	bundleData.setClassPathString(output.removeFirstSegments(1).toString());
Since both "BaseData" and "AbstractBundle" were restricted. Other than that, this code worked fine... and it has for three years (you can also see the exact code we use on http://git.eclipse.org/c/m2t/org.eclipse.acceleo.git/tree/plugins/org.eclipse.acceleo.common/src/org/eclipse/acceleo/common/internal/utils/workspace/AcceleoWorkspaceUtil.java#n1007 , the one method which accesses restricted code is setBundleClasspath(IProject, Bundle)).

However, both of these classes have now disappeared from Luna. The 'Bundle' we now have is an instance of EquinoxBundle. I haven't managed to find a workaround for these two lines of code, since I haven't seen any way (this time, even through restricted API) to alter the bundle's class path prior to refreshing it through the package admin.

My question would be : is there any API means to achieve my goal (deploying a workspace-defined bundle in the current eclipse instance)? If not, is there even a mean using classes that are subject to change (such as we did with BaseData from Helios to Kepler)? Is there any plan to support such a use case?

Laurent Goubet
Obeo
begin:vcard
fn:Laurent Goubet
n:Goubet;Laurent
org:<a href="http://www.obeo.fr";>Obeo</a>
email;internet:laurent.goubet@xxxxxxx
url:http://www.obeo.fr
version:2.1
end:vcard