org.eclipse.jetty.http.spi
Class ThreadPoolExecutorAdapter
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.http.spi.ThreadPoolExecutorAdapter
- All Implemented Interfaces:
- LifeCycle, ThreadPool
public class ThreadPoolExecutorAdapter
- extends AbstractLifeCycle
- implements ThreadPool
Jetty ThreadPool
that bridges requests to a ThreadPoolExecutor
.
ThreadPoolExecutorAdapter
public ThreadPoolExecutorAdapter(ThreadPoolExecutor executor)
dispatch
public boolean dispatch(Runnable job)
- Specified by:
dispatch
in interface ThreadPool
getIdleThreads
public int getIdleThreads()
- Specified by:
getIdleThreads
in interface ThreadPool
- Returns:
- The number of idle threads in the pool
getThreads
public int getThreads()
- Specified by:
getThreads
in interface ThreadPool
- Returns:
- The total number of threads currently in the pool
isLowOnThreads
public boolean isLowOnThreads()
- Specified by:
isLowOnThreads
in interface ThreadPool
- Returns:
- True if the pool is low on threads
join
public void join()
throws InterruptedException
- Description copied from interface:
ThreadPool
- Blocks until the thread pool is
stopped
.
- Specified by:
join
in interface ThreadPool
- Throws:
InterruptedException
isFailed
public boolean isFailed()
- Specified by:
isFailed
in interface LifeCycle
- Overrides:
isFailed
in class AbstractLifeCycle
- Returns:
- true if the component has failed to start or has failed to stop.
isRunning
public boolean isRunning()
- Specified by:
isRunning
in interface LifeCycle
- Overrides:
isRunning
in class AbstractLifeCycle
- Returns:
- true if the component is starting or has been started.
isStarted
public boolean isStarted()
- Specified by:
isStarted
in interface LifeCycle
- Overrides:
isStarted
in class AbstractLifeCycle
- Returns:
- true if the component has been started.
- See Also:
LifeCycle.start()
,
LifeCycle.isStarting()
isStarting
public boolean isStarting()
- Specified by:
isStarting
in interface LifeCycle
- Overrides:
isStarting
in class AbstractLifeCycle
- Returns:
- true if the component is starting.
- See Also:
LifeCycle.isStarted()
isStopped
public boolean isStopped()
- Specified by:
isStopped
in interface LifeCycle
- Overrides:
isStopped
in class AbstractLifeCycle
- Returns:
- true if the component has been stopped.
- See Also:
LifeCycle.stop()
,
LifeCycle.isStopping()
isStopping
public boolean isStopping()
- Specified by:
isStopping
in interface LifeCycle
- Overrides:
isStopping
in class AbstractLifeCycle
- Returns:
- true if the component is stopping.
- See Also:
LifeCycle.isStopped()
doStart
protected void doStart()
throws Exception
- Overrides:
doStart
in class AbstractLifeCycle
- Throws:
Exception
doStop
protected void doStop()
throws Exception
- Overrides:
doStop
in class AbstractLifeCycle
- Throws:
Exception
Copyright © 1995-2012 Mort Bay Consulting. All Rights Reserved.