adam bien's blog

Behind the Scenes (=Magic) of Dependency Injection in Quarkus 📎

Why the injection of @RequestScoped beans is in quarkus so fast?

The short answer is:


public HelloResource create(final CreationalContext creationalContext) {
    final HelloResource helloResource = new HelloResource();
    try {
        final InjectableReferenceProvider value = this.injectProviderSupplier1.get();
        helloResource.hello = (Hello)value.get((CreationalContext)CreationalContextImpl.child((InjectableReferenceProvider)value, creationalContext));
    }
    catch (RuntimeException ex) {
        throw new RuntimeException("Error injecting airhacks.Hello airhacks.HelloResource.hello", ex);
    }
    helloResource.initResource();
    return helloResource;
}

...and the 9 minutes explanation: