Package ghidra.trace.database.thread

# Class DBTraceThreadManager

java.lang.Object
ghidra.trace.database.thread.DBTraceThreadManager

All Implemented Interfaces:
  `ErrorHandler`, `DBTraceManager`, `TraceThreadManager`

public class DBTraceThreadManager extends Object implements TraceThreadManager, DBTraceManager

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final ReadWriteLock`
  `lock`
  `protected final DBTraceObjectManager`
  `objectManager`
  `protected final DBTrace`
  `trace`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DBTraceThreadManager(DBHandle dbh, OpenMode openMode, ReadWriteLock lock, TaskMonitor monitor, DBTrace trace, DBTraceObjectManager objectManager)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `TraceThread`
  `addThread(String path, Lifespan lifespan)`
  Add a thread with the given lifespan
  `TraceThread`
  `addThread(String path, String display, Lifespan lifespan)`
  Add a thread with the given lifespan
  `TraceThread`
  `assertIsMine(TraceThread thread)`
  `void`
  `dbError(IOException e)`
  Notification that an IO exception occurred.
  `Collection<? extends TraceThread>`
  `getAllThreads()`
  Get all threads ordered eldest first
  `TraceThread`
  `getLiveThreadByPath(long snap, String path)`
  Get the live thread at the given snap by the given path
  `Collection<? extends TraceThread>`
  `getLiveThreads(long snap)`
  Get live threads at the given snap, ordered eldest first
  `TraceThread`
  `getThread(long key)`
  Get the thread with the given key
  `Collection<? extends TraceThread>`
  `getThreadsByPath(String path)`
  Get all threads with the given name, ordered eldest first
  `void`
  `invalidateCache(boolean all)`
  Invalidate this manager's caches

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface ghidra.trace.model.thread.TraceThreadManager

  `createThread, createThread`

- ## Field Details

  - ### lock

    protected final ReadWriteLock lock

  - ### trace

    protected final DBTrace trace

  - ### objectManager

    protected final DBTraceObjectManager objectManager

- ## Constructor Details

  - ### DBTraceThreadManager

    public DBTraceThreadManager(DBHandle dbh, OpenMode openMode, ReadWriteLock lock, TaskMonitor monitor, DBTrace trace, DBTraceObjectManager objectManager) throws IOException, VersionException
    Throws:
      `IOException`
      `VersionException`

- ## Method Details

  - ### dbError

    public void dbError(IOException e)
    Description copied from interface: `ErrorHandler`
    Notification that an IO exception occurred.
    Specified by:
      `dbError` in interface `ErrorHandler`
    Parameters:
      `e` - `IOException` which was cause of error

  - ### invalidateCache

    public void invalidateCache(boolean all)
    Description copied from interface: `DBTraceManager`
    Invalidate this manager's caches
    Specified by:
      `invalidateCache` in interface `DBTraceManager`
    Parameters:
      `all` - probably nothing. Check out implementations of `ManagerDB.invalidateCache(boolean)`.

  - ### assertIsMine

    public TraceThread assertIsMine(TraceThread thread)

  - ### addThread

    public TraceThread addThread(String path, Lifespan lifespan) throws DuplicateNameException
    Description copied from interface: `TraceThreadManager`
    Add a thread with the given lifespan
    Specified by:
      `addThread` in interface `TraceThreadManager`
    Parameters:
      `path` - the "full name" of the thread
      `lifespan` - the lifespan of the thread
    Returns:
      the new thread
    Throws:
      `DuplicateNameException` - if a thread with the given full name already exists within an overlapping snap

  - ### addThread

    public TraceThread addThread(String path, String display, Lifespan lifespan) throws DuplicateNameException
    Description copied from interface: `TraceThreadManager`
    Add a thread with the given lifespan
    Specified by:
      `addThread` in interface `TraceThreadManager`
    Parameters:
      `path` - the "full name" of the thread
      `display` - "short name" of the thread
      `lifespan` - the lifespan of the thread
    Returns:
      the new thread
    Throws:
      `DuplicateNameException` - if a thread with the given full name already exists within an overlapping snap

  - ### getAllThreads

    public Collection<? extends TraceThread> getAllThreads()
    Description copied from interface: `TraceThreadManager`
    Get all threads ordered eldest first
    Specified by:
      `getAllThreads` in interface `TraceThreadManager`
    Returns:
      the collection

  - ### getThreadsByPath

    public Collection<? extends TraceThread> getThreadsByPath(String path)
    Description copied from interface: `TraceThreadManager`
    Get all threads with the given name, ordered eldest first
    Specified by:
      `getThreadsByPath` in interface `TraceThreadManager`
    Parameters:
      `path` - the name
    Returns:
      the collection

  - ### getLiveThreadByPath

    public TraceThread getLiveThreadByPath(long snap, String path)
    Description copied from interface: `TraceThreadManager`
    Get the live thread at the given snap by the given path
    Specified by:
      `getLiveThreadByPath` in interface `TraceThreadManager`
    Parameters:
      `snap` - the snap which the thread's lifespan must contain
      `path` - the path of the thread
    Returns:
      the thread, or `null` if no thread matches

  - ### getThread

    public TraceThread getThread(long key)
    Description copied from interface: `TraceThreadManager`
    Get the thread with the given key
    Specified by:
      `getThread` in interface `TraceThreadManager`
    Parameters:
      `key` - the database key
    Returns:
      the thread

  - ### getLiveThreads

    public Collection<? extends TraceThread> getLiveThreads(long snap)
    Description copied from interface: `TraceThreadManager`
    Get live threads at the given snap, ordered eldest first

    Note that thread whose destruction was observed at the given snap are not considered alive, i.e, the upper end of the lifespan is treated as open.

    Specified by:
      `getLiveThreads` in interface `TraceThreadManager`
    Parameters:
      `snap` - the snap
    Returns:
      the collection