Package org.eclipse.jetty.util.thread
Class ExecutorThreadPool
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.util.thread.ExecutorThreadPool
- All Implemented Interfaces:
Executor,Container,Destroyable,Dumpable,Dumpable.DumpableContainer,LifeCycle,ThreadPool,ThreadPool.SizedThreadPool,TryExecutor
- Direct Known Subclasses:
ExecutorSizedThreadPool
@ManagedObject("A thread pool")
@Deprecated(since="2021-05-27")
public class ExecutorThreadPool
extends ContainerLifeCycle
implements ThreadPool.SizedThreadPool, TryExecutor
Deprecated.
The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.
A
ThreadPool.SizedThreadPool wrapper around ThreadPoolExecutor.-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
Container.InheritedListener, Container.ListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.ListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.thread.ThreadPool
ThreadPool.SizedThreadPoolNested classes/interfaces inherited from interface org.eclipse.jetty.util.thread.TryExecutor
TryExecutor.NoTryExecutor -
Field Summary
Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPINGFields inherited from interface org.eclipse.jetty.util.thread.TryExecutor
NO_TRY -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.ExecutorThreadPool(int maxThreads) Deprecated.ExecutorThreadPool(int maxThreads, int minThreads) Deprecated.ExecutorThreadPool(int maxThreads, int minThreads, BlockingQueue<Runnable> queue) Deprecated.ExecutorThreadPool(ThreadPoolExecutor executor) Deprecated.ExecutorThreadPool(ThreadPoolExecutor executor, int reservedThreads) Deprecated.ExecutorThreadPool(ThreadPoolExecutor executor, int reservedThreads, ThreadGroup group) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoiddump(Appendable out, String indent) Deprecated.Dump this object (and children) into an Appendable using the provided indent after any new lines.voidDeprecated.intDeprecated.intDeprecated.intDeprecated.intDeprecated.getName()Deprecated.intDeprecated.Deprecated.intDeprecated.intDeprecated.booleanisDaemon()Deprecated.booleanDeprecated.booleanDeprecated.voidjoin()Deprecated.Blocks until the thread pool isstopped.voidsetDaemon(boolean daemon) Deprecated.voidsetDetailedDump(boolean detailedDump) Deprecated.voidsetIdleTimeout(int idleTimeout) Deprecated.Sets the maximum thread idle time in ms.voidsetMaxThreads(int threads) Deprecated.voidsetMinThreads(int threads) Deprecated.voidDeprecated.voidsetReservedThreads(int reservedThreads) Deprecated.Sets the number of reserved threads.voidsetThreadsPriority(int priority) Deprecated.toString()Deprecated.booleantryExecute(Runnable task) Deprecated.Attempt to execute a task.Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dump, dumpObject, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, unmanage, updateBean, updateBean, updateBeansMethods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stopMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpable
-
Constructor Details
-
ExecutorThreadPool
public ExecutorThreadPool()Deprecated. -
ExecutorThreadPool
public ExecutorThreadPool(int maxThreads) Deprecated. -
ExecutorThreadPool
public ExecutorThreadPool(int maxThreads, int minThreads) Deprecated. -
ExecutorThreadPool
Deprecated. -
ExecutorThreadPool
Deprecated. -
ExecutorThreadPool
Deprecated. -
ExecutorThreadPool
Deprecated.
-
-
Method Details
-
getName
Deprecated.- Returns:
- the name of the this thread pool
-
setName
Deprecated.- Parameters:
name- the name of this thread pool, used to name threads
-
getMinThreads
Deprecated.- Specified by:
getMinThreadsin interfaceThreadPool.SizedThreadPool- Returns:
- the minimum number of threads
-
setMinThreads
public void setMinThreads(int threads) Deprecated.- Specified by:
setMinThreadsin interfaceThreadPool.SizedThreadPool- Parameters:
threads- the minimum number of threads
-
getMaxThreads
Deprecated.- Specified by:
getMaxThreadsin interfaceThreadPool.SizedThreadPool- Returns:
- the maximum number of threads
-
setMaxThreads
public void setMaxThreads(int threads) Deprecated.- Specified by:
setMaxThreadsin interfaceThreadPool.SizedThreadPool- Parameters:
threads- the maximum number of threads
-
getIdleTimeout
Deprecated.- Returns:
- the maximum thread idle time in ms.
- See Also:
-
setIdleTimeout
public void setIdleTimeout(int idleTimeout) Deprecated.Sets the maximum thread idle time in ms.
Threads that are idle for longer than this period may be stopped.
- Parameters:
idleTimeout- the maximum thread idle time in ms.- See Also:
-
getReservedThreads
Deprecated.- Returns:
- number of reserved threads or -1 to indicate that the number is heuristically determined
- See Also:
-
setReservedThreads
public void setReservedThreads(int reservedThreads) Deprecated.Sets the number of reserved threads.- Parameters:
reservedThreads- number of reserved threads or -1 to determine the number heuristically- See Also:
-
setThreadsPriority
public void setThreadsPriority(int priority) Deprecated. -
getThreadsPriority
public int getThreadsPriority()Deprecated. -
isDaemon
Deprecated.- Returns:
- whether this thread pool uses daemon threads
- See Also:
-
setDaemon
public void setDaemon(boolean daemon) Deprecated.- Parameters:
daemon- whether this thread pool uses daemon threads- See Also:
-
isDetailedDump
Deprecated. -
setDetailedDump
public void setDetailedDump(boolean detailedDump) Deprecated. -
getThreads
Deprecated.- Specified by:
getThreadsin interfaceThreadPool- Returns:
- The total number of threads currently in the pool
-
getIdleThreads
Deprecated.- Specified by:
getIdleThreadsin interfaceThreadPool- Returns:
- The number of idle threads in the pool
-
execute
Deprecated.- Specified by:
executein interfaceExecutor- Specified by:
executein interfaceTryExecutor
-
tryExecute
Deprecated.Description copied from interface:TryExecutorAttempt to execute a task.- Specified by:
tryExecutein interfaceTryExecutor- 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.
-
isLowOnThreads
@ManagedAttribute(value="thread pool is low on threads", readonly=true) public boolean isLowOnThreads()Deprecated.- Specified by:
isLowOnThreadsin interfaceThreadPool- Returns:
- True if the pool is low on threads
-
join
Deprecated.Description copied from interface:ThreadPoolBlocks until the thread pool isstopped.- Specified by:
joinin interfaceThreadPool- Throws:
InterruptedException- if thread was interrupted
-
getThreadPoolBudget
Deprecated.- Specified by:
getThreadPoolBudgetin interfaceThreadPool.SizedThreadPool- Returns:
- a ThreadPoolBudget for this sized thread pool, or null of no ThreadPoolBudget can be returned
-
dump
Deprecated.Description copied from interface:DumpableDump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.- Specified by:
dumpin interfaceDumpable- Overrides:
dumpin classContainerLifeCycle- Parameters:
out- The appendable to dump toindent- The indent to apply after any new lines.- Throws:
IOException- if unable to write to Appendable
-
toString
Deprecated.- Overrides:
toStringin classAbstractLifeCycle
-