Class EventCaptureHandle
java.lang.Object
nl.pim16aap2.lightkeeper.framework.EventCaptureHandle
- All Implemented Interfaces:
AutoCloseable
Handle for a dynamic event capture session.
-
Method Summary
Modifier and TypeMethodDescriptioncancelNext(int count) Arms cancellation of the nextcountfired events of this capture's class.clear()Clears all captured events for this session.voidclose()Stops capturing events and unregisters the listener.Gets all captured events since the last clear or registration.
-
Method Details
-
eventClassName
- Returns:
- The captured event class name, without querying the server.
-
getCapturedEvents
Gets all captured events since the last clear or registration.- Returns:
- List of captured event snapshots.
-
cancelNext
Arms cancellation of the nextcountfired events of this capture's class.The agent registers a LOWEST-priority listener, so regular plugin listeners — and this capture's MONITOR listener — observe the cancelled state. Deterministic only: exactly the next
countevents are cancelled, with no predicate filtering. The event class must implementCancellable.Only one cancellation may be armed per event class at a time; arming again while one is active fails. Closing this handle disarms any remaining budget, so unexhausted cancellations never leak into later tests on a shared server.
- Parameters:
count- How many upcoming events to cancel; must be positive.- Returns:
- This handle for fluent chaining.
-
clear
Clears all captured events for this session.- Returns:
- This handle for fluent chaining.
-
close
public void close()Stops capturing events and unregisters the listener.- Specified by:
closein interfaceAutoCloseable
-