Class AotClassLoadingExamples
java.lang.Object
net.jrodolfo.java_evolution.java24.aot_class_loading.AotClassLoadingExamples
Demonstrates ahead-of-time class loading and linking, introduced in Java 24.
The example runs the explicit JEP 483 workflow: compile a tiny application, package it as a JAR, record AOT configuration, create an AOT cache, and run the application with that cache. It verifies workflow behavior, not startup speed.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordResult of the complete Java 24 AOT class-loading workflow.static final recordResult from one child process invocation. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionExplains class linking in learner-friendly terms.Explains class loading in learner-friendly terms.Explains the explicit Java 24 workflow.Source code for the tiny application used by the workflow.purpose()Explains the runtime goal.runAotClassLoadingWorkflow(Path workspace) Runs the Java 24 AOT class-loading workflow in a temporary workspace.Explains the test boundary for this executable example.
-
Constructor Details
-
AotClassLoadingExamples
public AotClassLoadingExamples()
-
-
Method Details
-
runAotClassLoadingWorkflow
public AotClassLoadingExamples.AotClassLoadingWorkflowResult runAotClassLoadingWorkflow(Path workspace) throws IOException, InterruptedException Runs the Java 24 AOT class-loading workflow in a temporary workspace.- Parameters:
workspace- temporary directory for source, classes, JAR, configuration, and cache files- Returns:
- result containing generated file paths, sizes, and command output
- Throws:
IOException- when files cannot be written or inspectedInterruptedException- when waiting for a child process is interrupted
-
probeSource
Source code for the tiny application used by the workflow.- Returns:
- generated Java source
-
purpose
-
classLoading
Explains class loading in learner-friendly terms.- Returns:
- a short class-loading explanation
-
classLinking
Explains class linking in learner-friendly terms.- Returns:
- a short class-linking explanation
-
java24Workflow
Explains the explicit Java 24 workflow.- Returns:
- a short workflow explanation
-
testBoundary
Explains the test boundary for this executable example.- Returns:
- a short test-boundary explanation
-