开发者

Guice: How to dynamically update definitions in a module w/out losing preexisting singletons

I would like to (re)create another Injector using the definitions already a part of another Inj开发者_如何学Pythonector with the following:

  • add, remove, replace existing definitions
  • singletons belonging to existing definitions in the "source" injector are carried over to the "new" injector.


The Guice SPI may help, albeit even partially. Guice 3.0 allows you to query the Injector for the current bindings.

The injector maintains immutable state for each binding so your success with this may or may not be the best.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜