2 Replies Latest reply on Jul 6, 2010 7:27 AM by ffang

    OSGI Bundle and Imports

    guest

      I've developed a few OSGI bundles that I launch with a specific feature.  One of the bundles is 'API'-oriented code that at runtime, basically reads a property file to find out which classes to load.  i.e.

       

      (Prop file):

      class=com.mycom.SampleClass

       

      (Code in bundle):

      Class.forName... //Does all the reflection based stuff to construct

       

       

      One of my other bundles define com.mycom.SampleClass.  But in order for my feature to run i have to put

      <Import-Package>com.mycom</Import-Package>

      in the 'API' bundle's pom.xml in order for it to run.  I feel like this makes my 'API' bundle have to be aware of package names of dynamically loaded classes at compile time.... Is there a better way to do this?  Thanks!