public class ThreadPoolExecutorAdapter extends AbstractLifeCycle implements ThreadPool
ThreadPool
that bridges requests to a ThreadPoolExecutor
.AbstractLifeCycle.AbstractLifeCycleListener
ThreadPool.SizedThreadPool
LifeCycle.Listener
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING
Constructor and Description |
---|
ThreadPoolExecutorAdapter(ThreadPoolExecutor executor) |
Modifier and Type | Method and Description |
---|---|
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 . |
addLifeCycleListener, getState, getState, removeLifeCycleListener, start, stop
public ThreadPoolExecutorAdapter(ThreadPoolExecutor executor)
public boolean dispatch(Runnable job)
dispatch
in interface ThreadPool
public int getIdleThreads()
getIdleThreads
in interface ThreadPool
public int getThreads()
getThreads
in interface ThreadPool
public boolean isLowOnThreads()
isLowOnThreads
in interface ThreadPool
public void join() throws InterruptedException
ThreadPool
stopped
.join
in interface ThreadPool
InterruptedException
public boolean isFailed()
isFailed
in interface LifeCycle
isFailed
in class AbstractLifeCycle
public boolean isRunning()
isRunning
in interface LifeCycle
isRunning
in class AbstractLifeCycle
public boolean isStarted()
isStarted
in interface LifeCycle
isStarted
in class AbstractLifeCycle
LifeCycle.start()
,
LifeCycle.isStarting()
public boolean isStarting()
isStarting
in interface LifeCycle
isStarting
in class AbstractLifeCycle
LifeCycle.isStarted()
public boolean isStopped()
isStopped
in interface LifeCycle
isStopped
in class AbstractLifeCycle
LifeCycle.stop()
,
LifeCycle.isStopping()
public boolean isStopping()
isStopping
in interface LifeCycle
isStopping
in class AbstractLifeCycle
LifeCycle.isStopped()
protected void doStart() throws Exception
doStart
in class AbstractLifeCycle
Exception
protected void doStop() throws Exception
doStop
in class AbstractLifeCycle
Exception
Copyright © 1995-2013 Mort Bay Consulting. All Rights Reserved.