Package org.eclipse.jetty.util.thread
Interface ThreadPool
- All Superinterfaces:
Executor
- All Known Subinterfaces:
ThreadPool.SizedThreadPool
- All Known Implementing Classes:
DelegatingThreadPool
,ExecutorThreadPool
,MonitoredQueuedThreadPool
,QueuedThreadPool
A pool for threads.
A specialization of Executor interface that provides reporting methods (eg getThreads()
)
and the option of configuration methods (e.g. @link ThreadPool.SizedThreadPool.setMaxThreads(int)
).
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Specialized sub-interface of ThreadPool that allows to get/set the minimum and maximum number of threads of the pool. -
Method Summary
-
Method Details
-
join
Blocks until the thread pool isstopped
.- Throws:
InterruptedException
- if thread was interrupted
-
getThreads
- Returns:
- The total number of threads currently in the pool
-
getIdleThreads
- Returns:
- The number of idle threads in the pool
-
isLowOnThreads
- Returns:
- True if the pool is low on threads
-