Using NetBeans RCP with Google Guice

I would like to use Google Guice (2.0 or 3.0, it does not matter) for my Netbeans platform project. My project has several Netbeans modules. I managed to use Guice in one Netbeans module, but now I want to embed a dependency on one NBModule on another. Is it possible? I googled a lot and searched netbeans and guice mailing lists, but nobody seems to have ever tried this.

I don't want to use the Lookup API for this, because I really need Injection Dependency for better testing.

Does anyone have any experience?

Edit: To be more specific: can I use the same injector for all NBModules or do I need to create an injector for each module?

+5
source share
2 answers

I understand that this question is old, but since the topic is still relevant, I decided to share my conclusions.

We successfully use Google Guice 3.0 in our Netbeans platform project. This includes dependency injection through NBM using a single injector. The only problem we encountered was that Guice did not recognize annotations in other NBMs because they were loaded through other classloaders. See http://tkills.blogspot.com/2014/08/using-google-guice-in-netbeans-rcp.html for more details .

+3
source

NetBeans RCP, Eclipse RCP Spring. Springs , , . , , . , , Guice .

0

All Articles