Package org.eclipse.jetty.util.thread
Interface ThreadPool
-
- All Superinterfaces:
java.util.concurrent.Executor
- All Known Subinterfaces:
ThreadPool.SizedThreadPool
- All Known Implementing Classes:
ExecutorSizedThreadPool
,ExecutorThreadPool
,MonitoredQueuedThreadPool
,QueuedThreadPool
@ManagedObject("Pool of Threads") public interface ThreadPool extends java.util.concurrent.Executor
A pool for threads.
A specialization of Executor interface that provides reporting methods (eg
getThreads()
) and the option of configuration methods (e.g. @linkThreadPool.SizedThreadPool.setMaxThreads(int)
).
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
ThreadPool.SizedThreadPool
Specialized sub-interface of ThreadPool that allows to get/set the minimum and maximum number of threads of the pool.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
getIdleThreads()
int
getThreads()
boolean
isLowOnThreads()
void
join()
Blocks until the thread pool isstopped
.
-
-
-
Method Detail
-
join
void join() throws java.lang.InterruptedException
Blocks until the thread pool isstopped
.- Throws:
java.lang.InterruptedException
- if thread was interrupted
-
getThreads
@ManagedAttribute("number of threads in pool") int getThreads()
- Returns:
- The total number of threads currently in the pool
-
getIdleThreads
@ManagedAttribute("number of idle threads in pool") int getIdleThreads()
- Returns:
- The number of idle threads in the pool
-
isLowOnThreads
@ManagedAttribute("indicates the pool is low on available threads") boolean isLowOnThreads()
- Returns:
- True if the pool is low on threads
-
-