Sky View Café - Java

org.shetline.util
Class ThreadPoolExecutor

java.lang.Object
  extended by org.shetline.util.ThreadPoolExecutor
All Implemented Interfaces:
Executor
Direct Known Subclasses:
SerialExecutor

public class ThreadPoolExecutor
extends Object
implements Executor


Nested Class Summary
protected  class ThreadPoolExecutor.PoolThread
           
 
Field Summary
static int DEFAULT_MAX_THREADS
           
static String DEFAULT_THREAD_NAME
           
protected  int maxThreads
           
protected  String name
           
protected  LinkedList<Runnable> queue
           
protected  boolean stopped
           
protected  ArrayList<Thread> threads
           
 
Constructor Summary
ThreadPoolExecutor()
           
ThreadPoolExecutor(int maxThreads)
           
ThreadPoolExecutor(String name)
           
ThreadPoolExecutor(String name, int maxThreads)
           
 
Method Summary
 void execute(Runnable task)
           
 int getBacklog()
           
 int getMaxConcurrentThreads()
           
 String getName()
           
 int getThreadCount()
           
 void setName(String name)
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

ThreadPoolExecutor

public ThreadPoolExecutor()

ThreadPoolExecutor

public ThreadPoolExecutor(int maxThreads)

ThreadPoolExecutor

public ThreadPoolExecutor(String name)

ThreadPoolExecutor

public ThreadPoolExecutor(String name,
                          int maxThreads)
Method Detail

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()

Sky View Café - Java