Class GuestHarness

java.lang.Object
cs1302.tracer.guest.GuestHarness

public final class GuestHarness extends Object
Resident execution harness running inside the persistent guest JVM.

The harness coordinates job execution dispatched by the tracer host, virtualizes standard input, isolates class loading via disposable child URLClassLoader instances, and notifies the host debugger via breakpoint sentinel hooks.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    In-memory redirected input stream dynamically backed by string content.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final AtomicLong
    Monotonic byte counter for guest standard error.
    static long
    Barrier snapshot of total standard error bytes at last completion.
    static String
    Harness failure message for the current job, or null.
    static String
    Dispatch parameter: target classpath set by host debugger.
    static String
    Dispatch parameter: target main entry class name set by host debugger.
    static String
    Dispatch parameter: target standard input content set by host debugger.
    static final AtomicLong
    Monotonic byte counter for guest standard output.
    static long
    Barrier snapshot of total standard output bytes at last completion.
    static boolean
    Control flag: instructs harness event loop to terminate process.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    main(String[] args)
    Main entry point for the guest JVM worker process.
    static void
    Sentinel hook invoked when a job execution completes.
    static void
    Sentinel hook invoked when the harness is idle and waiting for a job.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • nextClassPath

      public static volatile String nextClassPath
      Dispatch parameter: target classpath set by host debugger.
    • nextMainClass

      public static volatile String nextMainClass
      Dispatch parameter: target main entry class name set by host debugger.
    • nextStdin

      public static volatile String nextStdin
      Dispatch parameter: target standard input content set by host debugger.
    • shouldTerminate

      public static volatile boolean shouldTerminate
      Control flag: instructs harness event loop to terminate process.
    • OUT_BYTES

      public static final AtomicLong OUT_BYTES
      Monotonic byte counter for guest standard output.
    • ERR_BYTES

      public static final AtomicLong ERR_BYTES
      Monotonic byte counter for guest standard error.
    • outBytes

      public static volatile long outBytes
      Barrier snapshot of total standard output bytes at last completion.
    • errBytes

      public static volatile long errBytes
      Barrier snapshot of total standard error bytes at last completion.
    • lastHarnessFailure

      public static volatile String lastHarnessFailure
      Harness failure message for the current job, or null.
  • Method Details

    • main

      public static void main(String[] args)
      Main entry point for the guest JVM worker process.
      Parameters:
      args - Command-line arguments.
    • readyForJob

      public static void readyForJob()
      Sentinel hook invoked when the harness is idle and waiting for a job. The host debugger places a breakpoint here to synchronize before dispatching.
    • onJobCompleted

      public static void onJobCompleted()
      Sentinel hook invoked when a job execution completes. The host debugger places a breakpoint here to finalize snapshots and output capture.