Hi Thorsten,
> I wondering if it is possible to scan all available plugins if they
> are implementing a specific class.
Are you interested in this information only as a human? Or do you need to
know the computer to know programmatically at runtime for some reason?
If you are interested as a human, you can put all your code into an IDE
such as Eclipse, then view the Type Hierarchy of the specific class of
interest.
If you have no IDE and want to scan arbitrary binaries, you can use the
javap tool. I whipped up a script to demonstrate [1].
If you need the computer to know at runtime, I'd like to know more about
your use case. One solution is the SciJava/ImageJ2 plugin framework, which
supports different sorts of plugins annotated using the @Plugin annotation.
E.g., if you want to have a bunch of different "image transform" plugins
you could make an interface ImageTransform which extends ImageJPlugin and
then write "@Plugin(type = ImageTransform.class)" in front of each such
plugin. Then the SciJava/ImageJ2 PluginService will automatically be aware
of all such plugins on the classpath, and you can query them at runtime.
Regards,
Curtis
[1]
https://gist.github.com/ctrueden/3a68759c61dfeaa91a26On Fri, Feb 20, 2015 at 8:43 AM, Thorsten Wagner <
[hidden email]> wrote:
> Dear list,
>
> I wondering if it is possible to scan all available plugins if they are
> implementing a specific class.
>
> Any ideas?
>
> Cheers,
> Thorsten
>
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html