org.eclipse.jetty.http.spi
Class ThreadPoolExecutorAdapter

java.lang.Object
  extended by org.eclipse.jetty.util.component.AbstractLifeCycle
      extended by 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.


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.thread.ThreadPool
ThreadPool.SizedThreadPool
 
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
 
Field Summary
 
Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING
 
Constructor Summary
ThreadPoolExecutorAdapter(ThreadPoolExecutor executor)
           
 
Method Summary
 boolean dispatch(Runnable job)
           
protected  void doStart()
           
protected  void doStop()
           
 int getIdleThreads()
           
 int getThreads()
           
 boolean isFailed()
           
 boolean isLowOnThreads()
           
 boolean isRunning()
           
 boolean isStarted()
           
 boolean isStarting()
           
 boolean isStopped()
           
 boolean isStopping()
           
 void join()
          Blocks until the thread pool is stopped.
 
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, removeLifeCycleListener, start, stop, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ThreadPoolExecutorAdapter

public ThreadPoolExecutorAdapter(ThreadPoolExecutor executor)
Method Detail

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.