Class DelegatingThreadPool
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.http.spi.DelegatingThreadPool
- All Implemented Interfaces:
- Executor, Container, Destroyable, Dumpable, Dumpable.DumpableContainer, LifeCycle, ThreadPool, TryExecutor, VirtualThreads.Configurable
public class DelegatingThreadPool
extends ContainerLifeCycle
implements ThreadPool, TryExecutor, VirtualThreads.Configurable
- 
Nested Class SummaryNested classes/interfaces inherited from class AbstractLifeCycleAbstractLifeCycle.AbstractLifeCycleListener, AbstractLifeCycle.StopExceptionNested classes/interfaces inherited from interface ContainerContainer.InheritedListener, Container.ListenerNested classes/interfaces inherited from interface DumpableDumpable.DumpableContainerNested classes/interfaces inherited from interface LifeCycleLifeCycle.ListenerNested classes/interfaces inherited from interface ThreadPoolThreadPool.SizedThreadPoolNested classes/interfaces inherited from interface TryExecutorTryExecutor.NoTryExecutor
- 
Field SummaryFields inherited from interface TryExecutorNO_TRY
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voiddoStop()Stops the managed lifecycle beans in the reverse order they were added.voidintintbooleanvoidjoin()Blocks until the thread pool isstopped.voidsetExecutor(Executor executor) voidsetVirtualThreadsExecutor(Executor executor) booleantryExecute(Runnable task) Attempt to execute a task.Methods inherited from class ContainerLifeCycleaddBean, addBean, addEventListener, addManaged, contains, destroy, doStart, dump, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, installBean, installBean, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeansMethods inherited from class AbstractLifeCyclegetEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop, toStringMethods inherited from class Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ContainergetCachedBeans, getEventListenersMethods inherited from interface Dumpable.DumpableContainerisDumpableMethods inherited from interface VirtualThreads.ConfigurableisUseVirtualThreads, setUseVirtualThreads
- 
Constructor Details- 
DelegatingThreadPool
 
- 
- 
Method Details- 
getExecutor
- 
setExecutor
- 
execute- Specified by:
- executein interface- Executor
- Specified by:
- executein interface- TryExecutor
 
- 
tryExecuteDescription copied from interface:TryExecutorAttempt to execute a task.- Specified by:
- tryExecutein interface- TryExecutor
- Parameters:
- task- The task to be executed
- Returns:
- True IFF the task has been given directly to a thread to execute. The task cannot be queued pending the later availability of a Thread.
 
- 
getVirtualThreadsExecutor- Specified by:
- getVirtualThreadsExecutorin interface- VirtualThreads.Configurable
- Returns:
- the Executorto use to execute tasks in virtual threads
 
- 
setVirtualThreadsExecutor- Specified by:
- setVirtualThreadsExecutorin interface- VirtualThreads.Configurable
- Parameters:
- executor- the- Executorto use to execute tasks in virtual threads
- See Also:
 
- 
getIdleThreadspublic int getIdleThreads()- Specified by:
- getIdleThreadsin interface- ThreadPool
- Returns:
- The number of idle threads in the pool
 
- 
getThreadspublic int getThreads()- Specified by:
- getThreadsin interface- ThreadPool
- Returns:
- The total number of threads currently in the pool
 
- 
isLowOnThreadspublic boolean isLowOnThreads()- Specified by:
- isLowOnThreadsin interface- ThreadPool
- Returns:
- True if the pool is low on threads
 
- 
joinDescription copied from interface:ThreadPoolBlocks until the thread pool isstopped.- Specified by:
- joinin interface- ThreadPool
- Throws:
- InterruptedException- if thread was interrupted
 
- 
doStopDescription copied from class:ContainerLifeCycleStops the managed lifecycle beans in the reverse order they were added.- Overrides:
- doStopin class- ContainerLifeCycle
- Throws:
- Exception- If there was a problem stopping. Will cause a transition to FAILED state
 
 
-