felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Angelo van der Sijpt <angelo.vandersi...@luminis.eu>
Subject Re: how to list all classes from exported packages of a bundle?
Date Fri, 06 May 2011 17:56:36 GMT
Yes, I should have mentioned that 4.2 does not support this. In 4.2, you can find out the exported
packages using PackageAdmin, but the only way to find out the classes is to inspect the actual
bundle using getEntryPaths, as Peter has commented on the stackoverflow question. He also
notes that you will have to do the Bundle-ClassPath checking yourself, to find out where all
the classes can come from.

In short, there (currently) is no fool-proof way that gets you the classes in all cases, without
doing a whole lot of work yourself. You might have some chance if you can tightly control
the bundles you want to search, e.g. by mandating that only . can be on the bundle classpath.

Angelo


On May 6, 2011, at 7:25 PM, Cristiano Gavião wrote:

> Hi,
> well, this mean that in R4.2 version I can't do what I want or could I have
> some alternative?
> 
> cheers
> 
> 
> 2011/5/6 Richard S. Hall <heavy@ungoverned.org>
> 
>> Note that Felix does not yet implement the R4.3 spec, so the mentioned
>> BundleWiring approach is not possible yet...we're working on it though...
>> 
>> -> richard
>> 
>> 
>> On 5/6/11 9:17, Angelo van der Sijpt wrote:
>> 
>>> You could take a look at this Stackoverflow question:
>>> http://stackoverflow.com/questions/5856096/osgi-get-list-of-classes-in-package
>>> 
>>> The question assumes you know what package you're talking about, and you
>>> can find the exported packages by using
>>> BundleWiring.getProvidedWires(BundleRevision.PACKAGE_NAMESPACE).
>>> 
>>> Angelo
>>> 
>>> On May 6, 2011, at 3:05 PM, Cristiano Gavião wrote:
>>> 
>>> Hi,
>>>> 
>>>> I have a no-osgi api that I'm trying to port to osgi. In this api I have
>>>> a method that searchs for all classes in classpath that contain one
>>>> determinated annotation. So I want to do the same on OSGi.
>>>> 
>>>> I've started this challenge by creating one service bundle and I've
>>>> create fragments where is the searchable classes. I can find the properties
>>>> resources from the fragment nicely... but I can't find a solution for
>>>> classes investigation. :-s
>>>> 
>>>> I've found one service (org.osgi.service.packageadmin.PackageAdmin) that
>>>> gives me the exported packages and fragments (despite the fact it is
>>>> deprecated and is not part of OSGi 4.3 anymore) of a bundle. But the problem
>>>> is that the ExportedPackages don't gives me any option to list the classes
>>>> contained by it.
>>>> 
>>>> How could I do that ?
>>>> 
>>>> thanks for any help.
>>>> 
>>>> regards,
>>>> 
>>>> Cristiano
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>> 
>>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>> For additional commands, e-mail: users-help@felix.apache.org
>>> 
>>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>> 
>> 
> 
> 
> -- 
> "Tudo vale a pena se a alma não é pequena..."


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Mime
View raw message