org.shetline.util
Class ThreadPoolExecutor
java.lang.Object
org.shetline.util.ThreadPoolExecutor
- All Implemented Interfaces:
- Executor
- Direct Known Subclasses:
- SerialExecutor
public class ThreadPoolExecutor
- extends Object
- implements Executor
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
maxThreads
protected int maxThreads
name
protected String name
queue
protected LinkedList<Runnable> queue
stopped
protected boolean stopped
threads
protected ArrayList<Thread> threads
DEFAULT_MAX_THREADS
public static final int DEFAULT_MAX_THREADS
- See Also:
- Constant Field Values
DEFAULT_THREAD_NAME
public static final String DEFAULT_THREAD_NAME
- See Also:
- Constant Field Values
ThreadPoolExecutor
public ThreadPoolExecutor()
ThreadPoolExecutor
public ThreadPoolExecutor(int maxThreads)
ThreadPoolExecutor
public ThreadPoolExecutor(String name)
ThreadPoolExecutor
public ThreadPoolExecutor(String name,
int maxThreads)
getName
public String getName()
setName
public void setName(String name)
getMaxConcurrentThreads
public int getMaxConcurrentThreads()
execute
public void execute(Runnable task)
- Specified by:
execute
in interface Executor
getBacklog
public int getBacklog()
getThreadCount
public int getThreadCount()
stop
public void stop()