Class AotSerializedApplication

java.lang.Object
io.quarkus.bootstrap.runner.AotSerializedApplication

public class AotSerializedApplication extends Object
Serialization and deserialization of cached resources for AOT-optimized jar packaging. This class handles the serialization of frequently-accessed resources (like service loader files) to avoid classpath scanning at runtime, while maintaining compatibility with standard Java classloaders for optimal AOT performance. The format is versioned and includes a magic number for validation.
  • Constructor Details

  • Method Details

    • getMainClass

      public String getMainClass()
    • getRunnerClassLoader

      public AotRunnerClassLoader getRunnerClassLoader()
    • write

      public static void write(OutputStream out, String mainClass, List<Path> classPath) throws IOException
      Writes cached resources to an output stream in a binary format. Format: - Magic number (int) - Version (int) - Main class name (UTF string) - Fully indexed directory count (int) - For each fully indexed directory: . Directory path (UTF string) - Fully indexed resource count (int) - For each fully indexed resource: . Resource path (UTF string) - Service file count (int) - For each service file: . Resource path (UTF string) . Data length (int) . Data bytes
      Parameters:
      out - the output stream to write to
      mainClass - the main class name
      classPath - the full class path of the application
      Throws:
      IOException - if an I/O error occurs
    • read

      public static AotSerializedApplication read(InputStream in) throws IOException
      Reads cached resources from an input stream.
      Parameters:
      in - the input stream to read from
      Returns:
      an AotSerializedApplication containing the main class and cached resources
      Throws:
      IOException - if an I/O error occurs or the format is invalid