Class AotObjectCachingExamples

java.lang.Object
net.jrodolfo.java_evolution.java26.aot_object_caching.AotObjectCachingExamples

public class AotObjectCachingExamples extends Object
Demonstrates the Java 26 AOT object-caching command-line workflow.

The example launches a tiny source file in a child JVM with -XX:AOTCacheOutput, then launches it again with -XX:AOTCache. It verifies cache creation and reuse, not startup performance.

  • Constructor Details

    • AotObjectCachingExamples

      public AotObjectCachingExamples()
  • Method Details

    • runAotObjectCachingWorkflow

      public AotObjectCachingExamples.AotObjectCachingWorkflowResult runAotObjectCachingWorkflow(Path workspace) throws IOException, InterruptedException
      Creates and then uses an AOT object cache in a temporary workspace.
      Parameters:
      workspace - temporary directory for generated source and cache files
      Returns:
      results from both child-JVM runs and the generated cache metadata
      Throws:
      IOException - when the source cannot be written or a child process cannot be started
      InterruptedException - when waiting for a child process is interrupted
    • probeSource

      public String probeSource()
      Source code used by the child JVM.
      Returns:
      a small source-launcher program with stable output markers
    • problem

      public String problem()
      Explains the startup problem addressed by AOT object caching.
      Returns:
      a short problem statement
    • java26Idea

      public String java26Idea()
      Describes the Java 26 idea.
      Returns:
      a short feature explanation
    • testBoundary

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