Hi Philipp,

I guess that you mean "programmatically" ?

For an user perspective, you have the packages:export command for that.

Programmatically, you can use the PackageAdmin service for that.

Regards
JB

On 11/19/2013 06:20 PM, Philipp Hoenisch wrote:
Hey guys,

I'm not sure if this belongs in here or more to the Felix mailing list,
anyway, I'll give it a try:

versions i use:
karaf: 2.3.2
felix: 4.0.3

I'm trying to find a class which is located in one of the packages without
knowing it's name, however, I do know that it is annotated with a specific
annotation. This class is autogenerated using a maven plugin.
Anyway, what I try to do is to find this class (located in the same bundle)
and create an instance during runtime, aka right after the bundleActivator
was started

As the package name is known I tried a simple approach aka:

Thread.currentThread().getContextClassLoader().getResources(PACKAGENAME);

and then iterate over the the files.

The problem is that the ClassLoaders work a bit differently in OSGI right?

Can anyone point me to the right direction how I can find a particular
class?

thank you in advance,
best regards,
Philipp



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Finding-classes-in-a-Bundle-tp4030368.html
Sent from the Karaf - User mailing list archive at Nabble.com.


--
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com

Reply via email to