We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Micronaut allows to inject BeanContext and ApplicationContext. Guice can inject Injector.
BeanContext
ApplicationContext
Injector
My use case is that I'm trying to convert this code that uses guice to avaje-inject
// quartz job factory class GuiceJobFactory implements JobFactory { private final Injector injector; @Inject GuiceJobFactory(Injector injector) { this.injector = injector; } @Override public Job newJob(TriggerFiredBundle bundle, Scheduler scheduler) { Class<? extends Job> cls = bundle.getJobDetail().getJobClass(); return injector.getInstance(cls); } }
Thanks
The text was updated successfully, but these errors were encountered:
Oh wow, I didn't know that. Nice use case - dynamically obtain the job to run - got it.
I'll have a look and see how we can inject BeanScope to get the same effect.
BeanScope
Sorry, something went wrong.
#235 - Support injecting BeanScope
059d4ad
Injector.getBeanOfType()
Play.beanSource
Hi @natros , would you mind putting here that job factory snippet again, but now in the aveje-inject form? Thanks!
@Singleton class AvajeJobFactory implements JobFactory { private final BeanScope scope; AvajeJobFactory(BeanScope scope) { this.scope = scope; } @Override public Job newJob(TriggerFiredBundle bundle, Scheduler scheduler) { final Class<? extends Job> cls = bundle.getJobDetail().getJobClass(); return scope.get(cls); } }
rbygrave
Successfully merging a pull request may close this issue.
Micronaut allows to inject
BeanContext
andApplicationContext
. Guice can injectInjector
.My use case is that I'm trying to convert this code that uses guice to avaje-inject
Thanks
The text was updated successfully, but these errors were encountered: