Package org.eclipse.jetty.http.spi
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
-
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
FieldsFields 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
Constructors -
Method Summary
Modifier 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) booleantryExecute(Runnable task) Attempt to execute a task.Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, doStart, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpObjects, dumpStdErr, dumpThis, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, 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, stop, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpable
-
Field Details
-
_executor
-
_tryExecutor
-
-
Constructor Details
-
DelegatingThreadPool
-
-
Method Details
-
getExecutor
-
setExecutor
-
execute
- Specified by:
executein interfaceExecutor- Specified by:
executein interfaceTryExecutor
-
tryExecute
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.
-
getIdleThreads
public int getIdleThreads()- Specified by:
getIdleThreadsin interfaceThreadPool- Returns:
- The number of idle threads in the pool
-
getThreads
public int getThreads()- Specified by:
getThreadsin interfaceThreadPool- Returns:
- The total number of threads currently in the pool
-
isLowOnThreads
public boolean isLowOnThreads()- Specified by:
isLowOnThreadsin interfaceThreadPool- Returns:
- True if the pool is low on threads
-
join
Description copied from interface:ThreadPoolBlocks until the thread pool isstopped.- Specified by:
joinin interfaceThreadPool- Throws:
InterruptedException- if thread was interrupted
-
doStop
Description copied from class:ContainerLifeCycleStops the managed lifecycle beans in the reverse order they were added.- Overrides:
doStopin classContainerLifeCycle- Throws:
Exception
-