Class ThreadPoolBudget


  • @ManagedObject
    @Deprecated(since="2021-05-27")
    public class ThreadPoolBudget
    extends java.lang.Object
    Deprecated.
    The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.

    A budget of required thread usage, used to warn or error for insufficient configured threads.

    See Also:
    ThreadPool.SizedThreadPool.getThreadPoolBudget()
    • Constructor Detail

      • ThreadPoolBudget

        public ThreadPoolBudget​(ThreadPool.SizedThreadPool pool)
        Deprecated.
        Construct a budget for a SizedThreadPool.
        Parameters:
        pool - The pool to budget thread allocation for.
      • ThreadPoolBudget

        @Deprecated
        public ThreadPoolBudget​(ThreadPool.SizedThreadPool pool,
                                int warnAt)
        Deprecated.
        Parameters:
        pool - The pool to budget thread allocation for.
        warnAt - The level of free threads at which a warning is generated.
    • Method Detail

      • getLeasedThreads

        @ManagedAttribute("the number of threads leased to components")
        public int getLeasedThreads()
        Deprecated.
      • reset

        public void reset()
        Deprecated.
      • check

        public boolean check​(int maxThreads)
                      throws java.lang.IllegalStateException
        Deprecated.

        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:
        java.lang.IllegalStateException - if insufficient threads are configured.
      • leaseFrom

        public static ThreadPoolBudget.Lease leaseFrom​(java.util.concurrent.Executor executor,
                                                       java.lang.Object leasee,
                                                       int threads)
        Deprecated.