Class ThreadCapture

java.lang.Object
cs1302.tracer.trace.ThreadCapture

public final class ThreadCapture extends Object
Per-job thread discovery and event metadata for a dedicated guest JVM.
  • Constructor Details

    • ThreadCapture

      public ThreadCapture()
  • Method Details

    • install

      public void install(VirtualMachine vm, Collection<String> names)
      Installs lifecycle events before the initial VM suspension is resumed.
      Parameters:
      vm - Dedicated guest VM.
      names - Submitted class names.
    • observe

      public ThreadReference observe(Event value)
      Updates event context and returns a lifecycle thread requiring a snapshot.
      Parameters:
      value - Current debugger event.
      Returns:
      Application lifecycle thread, or null.
    • threads

      public List<ThreadReference> threads(ThreadReference trigger)
      Discovers application threads while all guest threads are suspended.
      Parameters:
      trigger - Event thread.
      Returns:
      Live application threads sorted by stable identity.
    • applicationClass

      public boolean applicationClass(String name)
      Tests whether a stack frame belongs to submitted code.
      Parameters:
      name - Declaring class name.
      Returns:
      True for submitted classes.
    • isDying

      public boolean isDying(ThreadReference thread)
      Tests whether the current event reports this thread's termination.
      Parameters:
      thread - Guest thread.
      Returns:
      True for the terminating thread.
    • event

      public String event()
      Returns the current event kind.
      Returns:
      Trace event kind.
    • state

      public static String state(ThreadReference thread)
      Maps the JDI status without confusing debugger suspension with application blocking.
      Parameters:
      thread - Guest thread.
      Returns:
      Stable status label.