You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Doing a code read of the execution path for generating clients and server stubs. Execution makes sense through the DefaultGenerator.java file, but it's also clear that the code base will use a language specific class. Right now I am interested in the MicronautServerCodegen class, extended up through JavaMicronautAbstractCodegen.
Java's not my primary language, fighting my way through it. I'm assuming there's an injection process where it uses the generators name in the config to attempt to load the language specific implementation.
appologies for the Junior question - thanks for any guidance.
The text was updated successfully, but these errors were encountered:
The injection (or loading) of MicronautServerCodegen class is done using Java SPI inteface, more on that topic can be found in the Oracle documentation here https://docs.oracle.com/javase/tutorial/sound/SPI-intro.html or other articles that you can find on the internet. And, the class is loaded by the given generator name, as you assumed in the comment.
Specifically, the class is loaded before DefaultGenerator execute generate from this line Generate.java#L527. If you go through the implementation, the class loading happens at CodegenConfigurator.java#L647 and is executed by CodegenConfigLoader util class. After the class is loaded, an instance is created using reflection and will be used for further generation.
Doing a code read of the execution path for generating clients and server stubs. Execution makes sense through the DefaultGenerator.java file, but it's also clear that the code base will use a language specific class. Right now I am interested in the MicronautServerCodegen class, extended up through JavaMicronautAbstractCodegen.
Java's not my primary language, fighting my way through it. I'm assuming there's an injection process where it uses the generators name in the config to attempt to load the language specific implementation.
appologies for the Junior question - thanks for any guidance.
The text was updated successfully, but these errors were encountered: