Package org.eclipse.jetty.util.thread
Class ThreadPoolBudget
java.lang.Object
org.eclipse.jetty.util.thread.ThreadPoolBudget
A budget of required thread usage, used to warn or error for insufficient configured threads.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
class
An allocation of threads -
Constructor Summary
ConstructorDescriptionConstruct a budget for a SizedThreadPool. -
Method Summary
Modifier and TypeMethodDescriptionboolean
check
(int maxThreads) Checks leases against the given number ofmaxThreads
.int
static ThreadPoolBudget.Lease
void
reset()
-
Constructor Details
-
ThreadPoolBudget
Construct a budget for a SizedThreadPool.- Parameters:
pool
- The pool to budget thread allocation for.
-
-
Method Details
-
getSizedThreadPool
-
getLeasedThreads
-
reset
public void reset() -
leaseTo
-
check
Checks leases against the given number of
maxThreads
.- Parameters:
maxThreads
- A proposed change to the maximum threads to check.- Returns:
- true if passes check, false if otherwise (see logs for details)
- Throws:
IllegalStateException
- if insufficient threads are configured.
-
leaseFrom
-