I am new to Quarkus and am trying to create an @ApplicationScoped instance of a class at runtime. I tried Class.forName("com.full.path.classname"); but the dependencies annotated with @Inject within the class are not injected. I figured this has to do with not using the proper class resolution, bypassing the DI manager.
Is there a way to do this in Quarkus? I have found plenty of docs on ArC and possibly BeanManager but I am just not seeing a clear path.
My use case is that I have an simple Interface (one method void execute();) defined with several classes that implement that interface. We store the class name of the implementor to use in our DB and would like to use that class name to get the correct implementor.
Executor executor = [resolve by name "com.org.specificExecutor"].execute(); // Psuedocode