Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[pde-dev] Inter-fragment dependencies


Hi,

given the following situation: A host bundle H, two fragments fragment1 (exporting package package1) and fragment2 attached to H. Using eclipse I cannot find a way to have direct access to package1 from within fragment2? Is there a possibility to write something in fragment2 like:


import package1;

SomeClassFromPackage1 x = new SomeClassFromPackage1();


assuming that fragment1 exports package1 and fragment2 imports package1. I have tried all my eclipse tricks but still the IDE won't let me do this...
On the OSGi mailing list BJ Hargrave and Thomas Watson told me this was not a general OSGi issue but a PDE issue.

What I figured out is that the following code snippet works in fragment2:

Object x =
this.getClass().getClassLoader().loadClass("package1.SomeClassFromPackage1").newInstance();

Best regards, Jens

Back to the top