Package io.quarkus.deployment.pkg.steps
Class ForkedJvmEnvironment
java.lang.Object
io.quarkus.deployment.pkg.steps.ForkedJvmEnvironment
- All Implemented Interfaces:
AutoCloseable
JAR tree-shake phase 3 environment: a temp directory pre-populated with generated/transformed
bytecode, the
ClassLoadingRecorder class, and JVM arguments. Created once
and reused across iterations of the fixed-point loop so that bytecode is written
to disk only once.-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()(package private) static ForkedJvmEnvironmentcreate(Map<String, Supplier<byte[]>> generatedBytecode, Map<String, Supplier<byte[]>> transformedBytecode, List<Path> depJarPaths, List<Path> appPaths) Prepares the forked JVM environment: creates a temp directory, writes bytecode, the recorder class, and JVM arguments.executeEntryPoints(Set<String> entryPointClasses, Set<String> allKnownClasses) Executes entry point classes in a forked JVM to capture which classes get loaded during static initialization and construction.
-
Method Details
-
create
static ForkedJvmEnvironment create(Map<String, Supplier<byte[]>> generatedBytecode, Map<String, throws IOExceptionSupplier<byte[]>> transformedBytecode, List<Path> depJarPaths, List<Path> appPaths) Prepares the forked JVM environment: creates a temp directory, writes bytecode, the recorder class, and JVM arguments.- Parameters:
generatedBytecode- generated classes (in-memory only, must be written to disk)transformedBytecode- transformed classes that override originals in dep JARsdepJarPaths- file system paths to dependency JARsappPaths- file system paths to the application artifact- Throws:
IOException
-
executeEntryPoints
Set<String> executeEntryPoints(Set<String> entryPointClasses, Set<String> allKnownClasses) throws IOException, InterruptedException Executes entry point classes in a forked JVM to capture which classes get loaded during static initialization and construction.- Parameters:
entryPointClasses- classes whose init/clinit triggers dynamic class loadingallKnownClasses- all known class names for Map value extraction and result filtering- Returns:
- discovered class names limited to
allKnownClasses, or empty set on failure - Throws:
IOExceptionInterruptedException
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-