On 5/23/10 18:32, Morten wrote:
--- Den man 24/5/10 skrev Richard S. Hall<[email protected]>:
Fra: Richard S. Hall<[email protected]>
Emne: Re: problem: getResources("META-INF/services/..") does not return all 
from imported bundles?
If the required bundle exports META-INF/services, then it
should work.
What is the syntax for exporting resources ? Does OSGI specify inport/export of 
non-java package stuff at all ?

No, it doesn't. That's what I am saying, the spec doesn't support it. However, the Felix framework impl doesn't do anything to prevent it.

However, technically, OSGi only supports exporting packages
and
META-INF/services is not a package so it is not supposed to
work.
Yes, that is what I am afraid of. It seems the OSGI guys did not think about 
resources - only classes ? (So require bundle does not in fact import 
everything - only the classes).

That is not accurate. Resources inside of packages are handled just fine, only resources not in packages are not handled. It would be difficult to do otherwise, since there is no naming convention for resources outside of packages that would not result in naming collisions or split "packages" all over the place.

Any advice ?
Typically, the approach is to use the extender pattern to
listen for
META-INF/services and then somehow register the provider so
it can be used.
Yes, I am also thinking about extender patteren. The problem is that jruby uses 
many more non-class resources that will also not work with 
classloader.getRessources. So after registering, JRuby will fail later on when 
trying to load its *.rb files etc.

Perhaps so. I'm not familiar enough with it to know.

-> richard

Thanks for your answer!

/Morten




---------------------------------------------------------------------
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]

Reply via email to