Class ExportReporterLifecycle

java.lang.Object
ai.attackframework.tools.burp.sinks.ExportReporterLifecycle

public final class ExportReporterLifecycle extends Object
Coordinates intentional shutdown and reset of long-lived export reporters.

This helper centralizes lifecycle transitions so UI stop actions, test teardown, and other reset paths do not need to duplicate per-reporter cleanup logic. Safe to call multiple times. Not all export paths maintain a scheduler, so this class stops only the reporters that own recurring background work or session-scoped reporter state.

  • Method Details

    • stopBackgroundReporters

      public static void stopBackgroundReporters()
      Stops recurring background reporters and clears their in-memory session state.

      Safe to call from any thread. Callers should set RuntimeConfig.setExportRunning(boolean) to false before invoking this method so in-flight work exits cooperatively.

    • stopAndClearPendingExportWork

      public static void stopAndClearPendingExportWork()
      Stops recurring reporters and clears queued export work that would otherwise keep retrying.

      Use when the UI transitions to a stopped state, including failed Start attempts, so the runtime matches what the Start/Stop controls show.

    • stopAndClearSessionState

      public static void stopAndClearSessionState()
      Stops recurring reporters and clears process-local exporter session state.

      Used by extension unload and test teardown so reloads start from a clean in-memory baseline.

    • resetForTests

      public static void resetForTests()
      Resets reporter-related process state for test teardown.

      In addition to stopping background reporters, this clears session-only credential state, cached Burp metadata, the Montoya API provider, and the export-running flag so subsequent tests start from a clean process-local baseline.