Class ForkedJvmEnvironment

java.lang.Object
io.quarkus.deployment.pkg.steps.ForkedJvmEnvironment
All Implemented Interfaces:
AutoCloseable

final class ForkedJvmEnvironment extends Object implements 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 Details

    • create

      static ForkedJvmEnvironment create(Map<String,Supplier<byte[]>> generatedBytecode, Map<String,Supplier<byte[]>> transformedBytecode, List<Path> depJarPaths, List<Path> appPaths) throws IOException
      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 JARs
      depJarPaths - file system paths to dependency JARs
      appPaths - 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 loading
      allKnownClasses - all known class names for Map value extraction and result filtering
      Returns:
      discovered class names limited to allKnownClasses, or empty set on failure
      Throws:
      IOException
      InterruptedException
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable