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.AbstractLifeCycleListener
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
Container.InheritedListener, Container.Listener
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.thread.ThreadPool
ThreadPool.SizedThreadPool
Nested 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, STOPPING
Fields 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 TypeMethodDescriptionvoid
dump
(Appendable out, String indent) Deprecated.Dump this object (and children) into an Appendable using the provided indent after any new lines.void
Deprecated.int
Deprecated.int
Deprecated.int
Deprecated.int
Deprecated.getName()
Deprecated.int
Deprecated.Deprecated.int
Deprecated.int
Deprecated.boolean
isDaemon()
Deprecated.boolean
Deprecated.boolean
Deprecated.void
join()
Deprecated.Blocks until the thread pool isstopped
.void
setDaemon
(boolean daemon) Deprecated.void
setDetailedDump
(boolean detailedDump) Deprecated.void
setIdleTimeout
(int idleTimeout) Deprecated.Sets the maximum thread idle time in ms.void
setMaxThreads
(int threads) Deprecated.void
setMinThreads
(int threads) Deprecated.void
Deprecated.void
setReservedThreads
(int reservedThreads) Deprecated.Sets the number of reserved threads.void
setThreadsPriority
(int priority) Deprecated.toString()
Deprecated.boolean
tryExecute
(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, updateBeans
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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:
getMinThreads
in interfaceThreadPool.SizedThreadPool
- Returns:
- the minimum number of threads
-
setMinThreads
public void setMinThreads(int threads) Deprecated.- Specified by:
setMinThreads
in interfaceThreadPool.SizedThreadPool
- Parameters:
threads
- the minimum number of threads
-
getMaxThreads
Deprecated.- Specified by:
getMaxThreads
in interfaceThreadPool.SizedThreadPool
- Returns:
- the maximum number of threads
-
setMaxThreads
public void setMaxThreads(int threads) Deprecated.- Specified by:
setMaxThreads
in 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:
getThreads
in interfaceThreadPool
- Returns:
- The total number of threads currently in the pool
-
getIdleThreads
Deprecated.- Specified by:
getIdleThreads
in interfaceThreadPool
- Returns:
- The number of idle threads in the pool
-
execute
Deprecated.- Specified by:
execute
in interfaceExecutor
- Specified by:
execute
in interfaceTryExecutor
-
tryExecute
Deprecated.Description copied from interface:TryExecutor
Attempt to execute a task.- Specified by:
tryExecute
in 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:
isLowOnThreads
in interfaceThreadPool
- Returns:
- True if the pool is low on threads
-
join
Deprecated.Description copied from interface:ThreadPool
Blocks until the thread pool isstopped
.- Specified by:
join
in interfaceThreadPool
- Throws:
InterruptedException
- if thread was interrupted
-
getThreadPoolBudget
Deprecated.- Specified by:
getThreadPoolBudget
in interfaceThreadPool.SizedThreadPool
- Returns:
- a ThreadPoolBudget for this sized thread pool, or null of no ThreadPoolBudget can be returned
-
dump
Deprecated.Description copied from interface:Dumpable
Dump 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:
dump
in interfaceDumpable
- Overrides:
dump
in 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:
toString
in classAbstractLifeCycle
-