Class ConnectionThreadPoolManager

java.lang.Object
com.lucimber.dbus.connection.ConnectionThreadPoolManager

public class ConnectionThreadPoolManager extends Object
Manages thread pools for D-Bus connections. This class encapsulates thread pool creation, configuration, and lifecycle management.
  • Constructor Details

    • ConnectionThreadPoolManager

      public ConnectionThreadPoolManager(String connectionId)
      Creates a new thread pool manager with default configuration.
      Parameters:
      connectionId - unique identifier for the connection
    • ConnectionThreadPoolManager

      public ConnectionThreadPoolManager(String connectionId, int threadPoolSize)
      Creates a new thread pool manager with specified thread pool size.
      Parameters:
      connectionId - unique identifier for the connection
      threadPoolSize - size of the thread pool
  • Method Details

    • getApplicationTaskExecutor

      public ExecutorService getApplicationTaskExecutor()
      Gets the application task executor.
      Returns:
      executor service for application tasks
    • getThreadPoolSize

      public int getThreadPoolSize()
      Gets the configured thread pool size.
      Returns:
      thread pool size
    • shutdown

      public void shutdown()
      Shuts down the thread pools gracefully. This method attempts to shut down the executor service gracefully, waiting for tasks to complete before forcing shutdown.
    • isShutdown

      public boolean isShutdown()
      Checks if the thread pools are shut down.
      Returns:
      true if shut down, false otherwise
    • isTerminated

      public boolean isTerminated()
      Checks if the thread pools are terminated.
      Returns:
      true if terminated, false otherwise