Bundle's are only a technicality that lies "below". Your real "first class" citizens in the OSGi world are the services. It is the same, when you want to "use" a bundle. What you in fact do, is that you do NOT lookup a bundle, but a service. So your dependecies are logically based on services. If you now start to do some "hard" wiring to a bundle, this will not be reflected by the service layer, and therefore breaks modularity.
bye, Michael > I see. But what's wrong with Require-Bundle? > > On 06.10.2010 17:23, Richard S. Hall wrote: > > On 10/6/10 1:58 AM, [email protected] wrote: > >> Thanks a lot for your explanation. > >> > >> I'll try to get rid of my own class inside groovy.lang package. > > > > Yes, that would be the best approach. You cannot do what you are > > trying to do with Import-Package/Export-Package since they do not > > support split packages at all. You would either need to use > > Require-Bundle or Fragment-Host to use split packages, but I don't > > recommend either unless there is no other way. > > > > -> richard > > > >> > >> On 06.10.2010 09:36, Felix Meschberger wrote: > >>> Hi, > >>> > >>> What you have here (and want to do) is a split-package situation, which > >>> is bad style and prone to fail. > >>> > >>> Thus, if your bundle exports groovy.lang, it should export the complete > >>> groovy.lang. But probably this is a very bad idae because you don't > >>> have > >>> the rest of the groovy bundle in your bundle. > >>> > >>> In your case I would try to find a way to solve your problem other than > >>> putting your own class into the groovy.lang package. > >>> > >>> Regards > >>> Felix > >>> > >>> > >>> On 06.10.2010 06:58, [email protected] wrote: > >>>> Hello! > >>>> > >>>> I have a problem with "Export-Package" directive. > >>>> > >>>> I have a bundle, which contains package "groovy.lang". This package > >>>> contains only one class, which I need to access protected method in > >>>> class in groovy library. > >>>> > >>>> I have another bundle "com.springsource.org.codehaus.groovy", which > >>>> exports packages "groovy.lang, org.codehaus.groovy" and etc. > >>>> > >>>> When I start maven-bundle-plugin, it adds classes from bundle > >>>> "com.springsource.org.codehaus.groovy" from package "groovy.lang" > >>>> to my > >>>> bundle, because my bundle has this package to. > >>>> > >>>> On the felix site I found example of such case: > >>>> > >>>> <Export-Package>org.osgi.service.log</Export-Package> > >>>> > >>>> "Notice that the<Export-Package> instruction specifies that the > >>>> bundle > >>>> exports the Log Service package, even though this package is not > >>>> contained in the bundle project. By declaring this, the plugin will > >>>> copy > >>>> the Log Service package into the resulting bundle JAR file. This is > >>>> useful in this case because now the bundle can resolve without > >>>> having to > >>>> download the entire compendium bundle." > >>>> > >>>> How I can prevent copying additional jar classes to my bundle? I > >>>> need to > >>>> import "groovy.lang" package into my bundle and merge it with my > >>>> "groovy.lang" package so that the classes, which are not exist in my > >>>> "groovy.lang" would be loaded from > >>>> "com.springsource.org.codehaus.groovy", and classes, which exist in my > >>>> "groovy.lang" package would be loaded from my bundle. > >>>> > >>> --------------------------------------------------------------------- > >>> To unsubscribe, e-mail: [email protected] > >>> For additional commands, e-mail: [email protected] > >>> > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: [email protected] > >> For additional commands, e-mail: [email protected] > >> > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [email protected] > > For additional commands, e-mail: [email protected] > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > The information included in this e-mail and any files transmitted with it is strictly confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please notify the sender immediately by e-mail and delete this e-mail as well as any attachment from your system. If you are not the intended recipient you are not authorized to use and/or copy this message and/or attachment and/or disclose the contents to any other person.

