Allow @PostConstruct annotation on Google Guice based app

2.3k Views Asked by At

I'm starting my way with google guice. Since guice does not support jsr-250 annotations out of the box I'm trying to bridge this gap. Specifically I'm interested on using @PostConstruct and @PreDestroy annotations.

  • I tried following guiceyfruit as described here with no success.
  • I tried mycila support for JSR-250 with no success (see section 3, JSR-250): injector = Guice.createInjector(Stage.PRODUCTION, new CloseableModule(), new Jsr250Module(), new MyModule()); Or using Jsr250.newJsr250Module() with no success.

Has anyone managed to use JSR-250 annotations in a guice based application and can show me how it is done?

Thanks

0

There are 0 best solutions below