0

How can I get Guice call my (Singleton) object's method AFTER the object graph has been built, and its dependencies have been injected? Is there an annotation that allows this?

At the moment I'm using constructor injection, which seems to guarantee that all the dependencies are there, and call my method from the constructor. But this seems like an awkward solution.

egbokul
  • 3,944
  • 7
  • 36
  • 54
  • Guice does not support lifecycles directly. You should use 3rd-party extensions for that. – Vladimir Matveev Feb 20 '14 at 18:25
  • Duplicate question indeed, too bad I didn't find the other question because of the title (I'm not interested merely in object instatiation, but injection). This can be closed. – egbokul Feb 21 '14 at 11:50

0 Answers0