Class AotClassLoadingExamples

java.lang.Object
net.jrodolfo.java_evolution.java24.aot_class_loading.AotClassLoadingExamples

public class AotClassLoadingExamples extends Object
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.

  • 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 inspected
      InterruptedException - when waiting for a child process is interrupted
    • probeSource

      public String probeSource()
      Source code for the tiny application used by the workflow.
      Returns:
      generated Java source
    • purpose

      public String purpose()
      Explains the runtime goal.
      Returns:
      a short explanation
    • classLoading

      public String classLoading()
      Explains class loading in learner-friendly terms.
      Returns:
      a short class-loading explanation
    • classLinking

      public String classLinking()
      Explains class linking in learner-friendly terms.
      Returns:
      a short class-linking explanation
    • java24Workflow

      public String java24Workflow()
      Explains the explicit Java 24 workflow.
      Returns:
      a short workflow explanation
    • testBoundary

      public String testBoundary()
      Explains the test boundary for this executable example.
      Returns:
      a short test-boundary explanation