Package io.quarkus.bootstrap.runner
Class AotSerializedApplication
java.lang.Object
io.quarkus.bootstrap.runner.AotSerializedApplication
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 Summary
ConstructorsConstructorDescriptionAotSerializedApplication(AotRunnerClassLoader runnerClassLoader, String mainClass) -
Method Summary
Modifier and TypeMethodDescriptionstatic AotSerializedApplicationread(InputStream in) Reads cached resources from an input stream.static voidwrite(OutputStream out, String mainClass, List<Path> classPath) Writes cached resources to an output stream in a binary format.
-
Constructor Details
-
AotSerializedApplication
-
-
Method Details
-
getMainClass
-
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 tomainClass- the main class nameclassPath- the full class path of the application- Throws:
IOException- if an I/O error occurs
-
read
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
-