Package cs1302.tracer.trace
Class ThreadCapture
java.lang.Object
cs1302.tracer.trace.ThreadCapture
Per-job thread discovery and event metadata for a dedicated guest JVM.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanapplicationClass(String name) Tests whether a stack frame belongs to submitted code.event()Returns the current event kind.voidinstall(VirtualMachine vm, Collection<String> names) Installs lifecycle events before the initial VM suspension is resumed.booleanisDying(ThreadReference thread) Tests whether the current event reports this thread's termination.Updates event context and returns a lifecycle thread requiring a snapshot.static Stringstate(ThreadReference thread) Maps the JDI status without confusing debugger suspension with application blocking.threads(ThreadReference trigger) Discovers application threads while all guest threads are suspended.
-
Constructor Details
-
ThreadCapture
public ThreadCapture()
-
-
Method Details
-
install
Installs lifecycle events before the initial VM suspension is resumed.- Parameters:
vm- Dedicated guest VM.names- Submitted class names.
-
observe
Updates event context and returns a lifecycle thread requiring a snapshot.- Parameters:
value- Current debugger event.- Returns:
- Application lifecycle thread, or null.
-
threads
Discovers application threads while all guest threads are suspended.- Parameters:
trigger- Event thread.- Returns:
- Live application threads sorted by stable identity.
-
applicationClass
Tests whether a stack frame belongs to submitted code.- Parameters:
name- Declaring class name.- Returns:
- True for submitted classes.
-
isDying
Tests whether the current event reports this thread's termination.- Parameters:
thread- Guest thread.- Returns:
- True for the terminating thread.
-
event
Returns the current event kind.- Returns:
- Trace event kind.
-
state
Maps the JDI status without confusing debugger suspension with application blocking.- Parameters:
thread- Guest thread.- Returns:
- Stable status label.
-