Thanks Tim!
That's exactly what I hoped for :)

Kind regards,
Thomas

------ Originalnachricht ------
Von: "Tim Ward" <tim.w...@paremus.com>
An: "Thomas Driessen" <thomas.driessen...@gmail.com>; "OSGi Developer Mail List" <osgi-dev@mail.osgi.org>
Gesendet: 23.01.2019 17:48:43
Betreff: Re: [osgi-dev] Scanning classes at runtime

Hi,

You can optimise this pretty heavily by using the bundle wirings to look for bundles which are wired to the same API packages as you (the one(s) that contain the relevant interface/supertype/annotation). This way you can avoid scanning bundles which can’t possibly contain relevant types.

Best Regards,

Tim

On 23 Jan 2019, at 16:10, Thomas Driessen via osgi-dev <osgi-dev@mail.osgi.org> wrote:

Hi,

for a project of mine I need to mimic the behavior of a ServletContainerInitializer [1], but with the dynamism of OSGi in mind.

Therefore, I need to be able to find all classes that implement/extend a specific class or are annotated with a specific annotation at runtime.

Is there a better way to do so that I'm not aware of than to scan each class of every bundle? Are there maybe framework hooks that would help me accomplish this?

I'm thankful for every hint you can provide.

Kind regards,
Thomas

[1] https://docs.oracle.com/javaee/6/api/javax/servlet/ServletContainerInitializer.html
_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev
_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to