Package com.lucimber.dbus.connection
Class ConnectionThreadPoolManager
java.lang.Object
com.lucimber.dbus.connection.ConnectionThreadPoolManager
Manages thread pools for D-Bus connections. This class encapsulates thread pool creation,
configuration, and lifecycle management.
-
Constructor Summary
ConstructorsConstructorDescriptionConnectionThreadPoolManager
(String connectionId) Creates a new thread pool manager with default configuration.ConnectionThreadPoolManager
(String connectionId, int threadPoolSize) Creates a new thread pool manager with specified thread pool size. -
Method Summary
Modifier and TypeMethodDescriptionGets the application task executor.int
Gets the configured thread pool size.boolean
Checks if the thread pools are shut down.boolean
Checks if the thread pools are terminated.void
shutdown()
Shuts down the thread pools gracefully.
-
Constructor Details
-
ConnectionThreadPoolManager
Creates a new thread pool manager with default configuration.- Parameters:
connectionId
- unique identifier for the connection
-
ConnectionThreadPoolManager
Creates a new thread pool manager with specified thread pool size.- Parameters:
connectionId
- unique identifier for the connectionthreadPoolSize
- size of the thread pool
-
-
Method Details
-
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
-