Has anyone used ServiceLoader together with Guice?

前端 未结 3 1725
既然无缘
既然无缘 2021-01-31 11:41

I keep wanting to try this on a larger scale with our app + build system, but higher priorities keep pushing it to the back burner. It seems like a nice way to load Guice module

3条回答
  •  情书的邮戳
    2021-01-31 11:48

    We're doing almost exactly this at my work. We're currently stuck in java 5 due to some internal limitations, so we do it a bit differently using Service Provider (due to not having access to ServiceLocator until java 6 like you mentioned), but it essentially works the same.

    I remember reading somewhere that this was one of the preferred ways the Guice developers recommended, though they want to leave this open for flexibility.

提交回复
热议问题