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:
java.util.concurrent.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.AThreadPool.SizedThreadPool
wrapper aroundThreadPoolExecutor
.
-
-
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
Constructors Constructor Description ExecutorThreadPool()
Deprecated.ExecutorThreadPool(int maxThreads)
Deprecated.ExecutorThreadPool(int maxThreads, int minThreads)
Deprecated.ExecutorThreadPool(int maxThreads, int minThreads, java.util.concurrent.BlockingQueue<java.lang.Runnable> queue)
Deprecated.ExecutorThreadPool(java.util.concurrent.ThreadPoolExecutor executor)
Deprecated.ExecutorThreadPool(java.util.concurrent.ThreadPoolExecutor executor, int reservedThreads)
Deprecated.ExecutorThreadPool(java.util.concurrent.ThreadPoolExecutor executor, int reservedThreads, java.lang.ThreadGroup group)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
dump(java.lang.Appendable out, java.lang.String indent)
Deprecated.Dump this object (and children) into an Appendable using the provided indent after any new lines.void
execute(java.lang.Runnable command)
Deprecated.int
getIdleThreads()
Deprecated.int
getIdleTimeout()
Deprecated.int
getMaxThreads()
Deprecated.int
getMinThreads()
Deprecated.java.lang.String
getName()
Deprecated.int
getReservedThreads()
Deprecated.ThreadPoolBudget
getThreadPoolBudget()
Deprecated.int
getThreads()
Deprecated.int
getThreadsPriority()
Deprecated.boolean
isDaemon()
Deprecated.boolean
isDetailedDump()
Deprecated.boolean
isLowOnThreads()
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
setName(java.lang.String name)
Deprecated.void
setReservedThreads(int reservedThreads)
Deprecated.Sets the number of reserved threads.void
setThreadsPriority(int priority)
Deprecated.java.lang.String
toString()
Deprecated.boolean
tryExecute(java.lang.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 Detail
-
ExecutorThreadPool
public ExecutorThreadPool()
Deprecated.
-
ExecutorThreadPool
public ExecutorThreadPool(int maxThreads)
Deprecated.
-
ExecutorThreadPool
public ExecutorThreadPool(int maxThreads, int minThreads)
Deprecated.
-
ExecutorThreadPool
public ExecutorThreadPool(int maxThreads, int minThreads, java.util.concurrent.BlockingQueue<java.lang.Runnable> queue)
Deprecated.
-
ExecutorThreadPool
public ExecutorThreadPool(java.util.concurrent.ThreadPoolExecutor executor)
Deprecated.
-
ExecutorThreadPool
public ExecutorThreadPool(java.util.concurrent.ThreadPoolExecutor executor, int reservedThreads)
Deprecated.
-
ExecutorThreadPool
public ExecutorThreadPool(java.util.concurrent.ThreadPoolExecutor executor, int reservedThreads, java.lang.ThreadGroup group)
Deprecated.
-
-
Method Detail
-
getName
@ManagedAttribute("name of this thread pool") public java.lang.String getName()
Deprecated.- Returns:
- the name of the this thread pool
-
setName
public void setName(java.lang.String name)
Deprecated.- Parameters:
name
- the name of this thread pool, used to name threads
-
getMinThreads
@ManagedAttribute("minimum number of threads in the pool") public int 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
@ManagedAttribute("maximum number of threads in the pool") public int 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
@ManagedAttribute("maximum time a thread may be idle in ms") public int getIdleTimeout()
Deprecated.- Returns:
- the maximum thread idle time in ms.
- See Also:
setIdleTimeout(int)
-
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:
getIdleTimeout()
-
getReservedThreads
@ManagedAttribute("the number of reserved threads in the pool") public int getReservedThreads()
Deprecated.- Returns:
- number of reserved threads or -1 to indicate that the number is heuristically determined
- See Also:
setReservedThreads(int)
-
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:
getReservedThreads()
-
setThreadsPriority
public void setThreadsPriority(int priority)
Deprecated.
-
getThreadsPriority
public int getThreadsPriority()
Deprecated.
-
isDaemon
@ManagedAttribute("whether this thread pool uses daemon threads") public boolean isDaemon()
Deprecated.- Returns:
- whether this thread pool uses daemon threads
- See Also:
setDaemon(boolean)
-
setDaemon
public void setDaemon(boolean daemon)
Deprecated.- Parameters:
daemon
- whether this thread pool uses daemon threads- See Also:
Thread.setDaemon(boolean)
-
isDetailedDump
@ManagedAttribute("reports additional details in the dump") public boolean isDetailedDump()
Deprecated.
-
setDetailedDump
public void setDetailedDump(boolean detailedDump)
Deprecated.
-
getThreads
@ManagedAttribute("number of threads in the pool") public int getThreads()
Deprecated.- Specified by:
getThreads
in interfaceThreadPool
- Returns:
- The total number of threads currently in the pool
-
getIdleThreads
@ManagedAttribute("number of idle threads in the pool") public int getIdleThreads()
Deprecated.- Specified by:
getIdleThreads
in interfaceThreadPool
- Returns:
- The number of idle threads in the pool
-
execute
public void execute(java.lang.Runnable command)
Deprecated.- Specified by:
execute
in interfacejava.util.concurrent.Executor
- Specified by:
execute
in interfaceTryExecutor
-
tryExecute
public boolean tryExecute(java.lang.Runnable task)
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
public void join() throws java.lang.InterruptedException
Deprecated.Description copied from interface:ThreadPool
Blocks until the thread pool isstopped
.- Specified by:
join
in interfaceThreadPool
- Throws:
java.lang.InterruptedException
- if thread was interrupted
-
getThreadPoolBudget
public ThreadPoolBudget 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
public void dump(java.lang.Appendable out, java.lang.String indent) throws java.io.IOException
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:
java.io.IOException
- if unable to write to Appendable
-
toString
public java.lang.String toString()
Deprecated.- Overrides:
toString
in classAbstractLifeCycle
-
-