1

I want to use the lifecycle feature of Governator without calling Governator.createInjector because I already have some wrapper around my Guice injector and switching the two will be rather tricky.

The documentation, says the following:

Governator provides a simple wrapper to Guice's Guice.createInjector through which lifecycle management is added.

Later, examples are given as alternatives to awaitTermination(), including in-injector possibilities.

This seems to indicate that I have the possibility to not use Governator.createInjector at all.

If this is true, how can I use Governator's lifecycle feature using only modules? Which modules do I have to load? LifecycleModule seems a no-brainer, but are there others?

Olivier Grégoire
  • 33,839
  • 23
  • 96
  • 137
  • [Here](https://github.com/Netflix/governator/blob/43328b9592f05b2c08508904acfe25b385f35b96/governator-core/src/main/java/com/netflix/governator/Governator.java#L58)'s the implementation. – Tavian Barnes Nov 20 '15 at 16:52
  • Thank you. However given that I put a link at the source package folder, I believe it was rather obvious I already had a look at the source code somehow. Well... I did, and I don't want to go deep into the class graph to learn about every nook and cranny of Governor. I indeed saw that `LifecycleModule` is the only concrete module loaded, but what is the rest up to? Do I have to do anything? I think it's acceptable to read documentation to find out such answers. But code? No, I think it's too much, especially when it can be adapted rather quickly when the documentation is more static. – Olivier Grégoire Nov 20 '15 at 21:26
  • Well, the answer to your question doesn't seem to appear in the documentation, so I checked the source code. It's only 40 lines. – Tavian Barnes Nov 20 '15 at 22:39
  • Indeed, only 40 locs. With several governator-specific 40 locs dependencies with each other 40 governator-specifc locs dependencies with each other 40 governator-specifc locs dependencies. Hmmm, it starts to grow... maybe I should ask a question about it instead. If only some website was designed to ask such questions... – Olivier Grégoire Nov 20 '15 at 22:56

0 Answers0