Closed ludmiloff closed 3 months ago
I'd do it more like this:
@Factory
public class App extends Jooby {
public App(MyController controller) {
install(new HikariModule());
install(new JdbiModule());
install(new NettyServer());
mvc(controller);
}
@Bean
Jdbi getJdbi() {
return require(Jdbi.class);
}
@Bean
Config appConfig() {
return getConfig();
}
}
but yeah I can work on adding a sort of Avaje Inject Module.
Hello, I'm looking for a more complex Avaje usage, such as building
@Singleton
repositories, services etc. which are supposed to access a database or some other Jooby module.Jooby itself brings its own kind-of service / dependency registration. The GuiceModule integrates with Jooby very well. Unfortunately, this is not the case with Avaje, which is completely not aware of Jooby internals.
In particular, I've managed a workaround (see source below) by declaring the App class being a
@Factory
. It works for a simple use case, despite it seems not optimal to me.Where I stuck is QuartzModule with some jobs being declared as
@Singleton
. I'm really looking for some more idiomatic way, please advice.