Class ApplicationClassGenerator
java.lang.Object
org.ek9lang.compiler.backend.jvm.ApplicationClassGenerator
Generates a single global
_Application JVM class from application registrations.
Contains public static fields for each registered component or service (field name is the
mangled FQN), a private constructor, and a static _bind(HTTP) method that wires
service route tables to the HTTP server at startup.
The _Application class is a global singleton at the root level (no module prefix).
Only one program runs per runtime, so there is exactly one _Application class.
Injection sites can access it via GETSTATIC without knowing which application
or module populated the fields.
This is the JVM-specific backend for application code generation, called by
CodeGenerationApplications. LLVM backend would have its own equivalent.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordBinding information for a service registration that has HTTP routes. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidgenerate(List<AggregateSymbol> applications, Map<String, ApplicationClassGenerator.ServiceBindingInfo> serviceBindings, File outputDirectory) Generate the global _Application.class file.
-
Constructor Details
-
ApplicationClassGenerator
-
-
Method Details
-
generate
public void generate(List<AggregateSymbol> applications, Map<String, ApplicationClassGenerator.ServiceBindingInfo> serviceBindings, File outputDirectory) Generate the global _Application.class file. Only one program runs per runtime, so this is a root-level singleton.- Parameters:
applications- all application symbols across all modulesserviceBindings- map from service implementation FQN to its route detailsoutputDirectory- the base output directory for generated class files
-