Class SwingTaskManager

java.lang.Object
uno.anahata.asi.agi.event.BasicPropertyChangeSource
uno.anahata.asi.swing.internal.SwingTaskManager
All Implemented Interfaces:
PropertyChangeSource, Rebindable

public class SwingTaskManager extends BasicPropertyChangeSource
A centralized registry for tracking active SwingTask instances.

This manager provides real-time observability into background activities initiated by the Swing UI. It allows components like the StatusPanel to display progress and status messages for non-AI tasks (e.g., token calculation, file system operations).

Author:
anahata
  • Field Details

    • INSTANCE

      private static final SwingTaskManager INSTANCE
      The global singleton manager instance.
    • activeTasks

      private final List<SwingTask<?>> activeTasks
      The thread-safe concurrent list tracking all uncompleted background actions.
  • Constructor Details

    • SwingTaskManager

      private SwingTaskManager()
      Private constructor preventing instantiation from other packages.
  • Method Details

    • getInstance

      public static SwingTaskManager getInstance()
      Gets the singleton instance of the task manager.
      Returns:
      The task manager instance.
    • taskStarted

      public void taskStarted(SwingTask<?> task)
      Registers a task as started.
      Parameters:
      task - The task that started.
    • taskFinished

      public void taskFinished(SwingTask<?> task)
      Unregisters a task as finished.
      Parameters:
      task - The task that finished.
    • getActiveTasks

      public List<SwingTask<?>> getActiveTasks()
      Gets an unmodifiable list of currently active swing tasks.
      Returns:
      The list of active tasks.