Package org.jboss.jca.web
Class ExecutorThreadPool
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.jboss.jca.web.ExecutorThreadPool
- All Implemented Interfaces:
org.eclipse.jetty.util.component.LifeCycle,org.eclipse.jetty.util.thread.ThreadPool
public class ExecutorThreadPool
extends org.eclipse.jetty.util.component.AbstractLifeCycle
implements org.eclipse.jetty.util.thread.ThreadPool
An implementation of the Jetty ThreadPool interface using an ExecutorService
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
org.eclipse.jetty.util.component.LifeCycle.ListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.thread.ThreadPool
org.eclipse.jetty.util.thread.ThreadPool.SizedThreadPool -
Field Summary
Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
-
Constructor Details
-
ExecutorThreadPool
Constrcutor- Parameters:
executor- The executor service
-
-
Method Details
-
dispatch
Dispatch a job- Specified by:
dispatchin interfaceorg.eclipse.jetty.util.thread.ThreadPool- Parameters:
job- The job- Returns:
- True if dispatched; otherwise false
-
getIdleThreads
public int getIdleThreads()Get the number of idle threads- Specified by:
getIdleThreadsin interfaceorg.eclipse.jetty.util.thread.ThreadPool- Returns:
- The number; -1 if not supported
-
getThreads
public int getThreads()Get the number of threads- Specified by:
getThreadsin interfaceorg.eclipse.jetty.util.thread.ThreadPool- Returns:
- The number; -1 if not supported
-
isLowOnThreads
public boolean isLowOnThreads()Is the pool low on threads ?- Specified by:
isLowOnThreadsin interfaceorg.eclipse.jetty.util.thread.ThreadPool- Returns:
- True if active threads >= maximum number of threads
-
join
Join - await termination of pool- Specified by:
joinin interfaceorg.eclipse.jetty.util.thread.ThreadPool- Throws:
InterruptedException- Thrown if interrupted
-
doStart
Start- Overrides:
doStartin classorg.eclipse.jetty.util.component.AbstractLifeCycle- Throws:
Exception- Thrown if an error occurs
-
doStop
Stop- Overrides:
doStopin classorg.eclipse.jetty.util.component.AbstractLifeCycle- Throws:
Exception- Thrown if an error occurs
-