Re: Optional Module Dependency

cobusve <[email protected]> Tue, 7 Nov 2017 09:02:16 -0700 (MST)
Newsgroups gmane.comp.java.netbeans.modules.openide.devel
Message-ID <[email protected]>
Yes I did consider the service provider, but since the other module is not
under my control that option does not work, as I would have to convince the
vendor to ship their interface as a separate module.

What you describe with the SystemClass Loader is exactly what I did to make
it work using reflection, but I generally try to avoid reflection like the
plague.

I was hoping that I was missing some secret sauce, that I am just not using
OpenIDE-Module-Recommends  correctly, because from the description that is
exactly what I need.

From the Modules API documentation "Moreover there is also
OpenIDE-Module-Recommends which is even weaker version as it creates a
conditional dependency - e.g. enables the module providing the token only if
it is available, however if it is not, no dependency is broken."

So this seemed like it will do exactly what I need - load the dependency
when it exists and continue if it does not, and it does this when installing
the module, but when you activate the module it fails activation, which gets
me only halfway. If only the activation also paid attention to the
OpenIDE-Module-Recommends ?



--
Sent from: http://netbeans-org.1045718.n5.nabble.com/Netbeans-RCP-Platform-Users-Open-API-f3018772.html