public class ThreadPool1
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
THREAD_FULL_EVENT |
Constructor and Description |
---|
ThreadPool1() |
ThreadPool1(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Checks if the launcher should start another thread.
|
void |
closeEnvironment(java.lang.ClassLoader env)
Resets the thread pool, letting old threads drain.
|
void |
completeExecutorTask()
Called when an executor task completes
|
static ThreadPool1 |
getCurrent() |
int |
getExecutorTaskMax()
Gets the maximum number of executor threads.
|
int |
getFreeThreadCount()
Returns the free thread count.
|
int |
getIdleMax()
Returns the thread idle max.
|
int |
getIdleMin()
Gets the minimum number of idle threads.
|
long |
getIdleTimeout()
Returns the idle timeout.
|
int |
getPriorityIdleCount()
Returns the priority idle thread count.
|
int |
getPriorityIdleMin() |
int |
getThreadActiveCount()
Returns the active thread count.
|
int |
getThreadCount()
Returns the total thread count.
|
long |
getThreadCreateCountTotal()
Returns the total created thread count.
|
int |
getThreadIdleCount()
Returns the idle thread count.
|
int |
getThreadMax()
Gets the maximum number of threads.
|
long |
getThreadOverflowCountTotal()
Returns the total created overflow thread count.
|
static ThreadPool1 |
getThreadPool() |
int |
getThreadPriorityQueueSize()
Returns priority queue size
|
int |
getThreadStartingCount()
Returns the starting thread count.
|
int |
getThreadTaskQueueSize()
Returns task queue size
|
int |
getThreadWaitCount()
Returns the waiting thread count.
|
void |
interrupt()
interrupts all the idle threads.
|
void |
reset()
Resets the thread pool, letting old threads drain.
|
boolean |
schedule(java.lang.Runnable task)
Schedules a new task.
|
boolean |
schedule(java.lang.Runnable task,
java.lang.ClassLoader loader)
Schedules a new task.
|
boolean |
schedule(java.lang.Runnable task,
long timeout)
Adds a new task.
|
boolean |
scheduleExecutorTask(java.lang.Runnable task)
Schedules an executor task.
|
void |
schedulePriority(java.lang.Runnable task)
Adds a new task.
|
protected void |
setAsGlobal(ThreadPool1 threadPool) |
void |
setExecutorTaskMax(int max)
Sets the maximum number of executor threads.
|
void |
setIdleMax(int idleMax)
Returns the thread idle max.
|
void |
setIdleMin(int min)
Sets the minimum number of idle threads.
|
void |
setIdleTimeout(long timeout)
Sets the idle timeout
|
void |
setPriorityIdleMin(int priority)
Sets the minimum number of free threads reserved for priority tasks.
|
void |
setThreadMax(int max)
Sets the maximum number of threads.
|
void |
setThrottleLimit(int limit)
Sets the throttle limit.
|
void |
setThrottlePeriod(long period)
Sets the throttle period.
|
void |
setThrottleSleepTime(long period)
Sets the throttle sleep time.
|
void |
start() |
boolean |
start(java.lang.Runnable task)
Adds a new task.
|
boolean |
start(java.lang.Runnable task,
long timeout)
Adds a new task.
|
void |
startPriority(java.lang.Runnable task)
Adds a new task.
|
boolean |
startPriority(java.lang.Runnable task,
long timeout)
Adds a new task.
|
java.lang.String |
toString() |
public static final java.lang.String THREAD_FULL_EVENT
public ThreadPool1()
public ThreadPool1(java.lang.String name)
public static ThreadPool1 getCurrent()
public static ThreadPool1 getThreadPool()
protected void setAsGlobal(ThreadPool1 threadPool)
public void setThreadMax(int max)
public int getThreadMax()
public void setIdleMin(int min)
public int getIdleMin()
public int getIdleMax()
public void setIdleMax(int idleMax)
public void setIdleTimeout(long timeout)
public long getIdleTimeout()
public void setPriorityIdleMin(int priority)
public int getPriorityIdleMin()
public void setThrottlePeriod(long period)
public void setThrottleLimit(int limit)
public void setThrottleSleepTime(long period)
public void setExecutorTaskMax(int max)
public int getExecutorTaskMax()
public int getThreadCount()
public int getThreadActiveCount()
public int getThreadStartingCount()
public int getThreadIdleCount()
public int getPriorityIdleCount()
public int getThreadWaitCount()
public int getFreeThreadCount()
public long getThreadCreateCountTotal()
public long getThreadOverflowCountTotal()
public int getThreadPriorityQueueSize()
public int getThreadTaskQueueSize()
public void start()
public boolean schedule(java.lang.Runnable task)
public boolean schedule(java.lang.Runnable task, java.lang.ClassLoader loader)
public boolean schedule(java.lang.Runnable task, long timeout)
public void schedulePriority(java.lang.Runnable task)
public boolean scheduleExecutorTask(java.lang.Runnable task)
public void completeExecutorTask()
public boolean start(java.lang.Runnable task)
public boolean start(java.lang.Runnable task, long timeout)
public void startPriority(java.lang.Runnable task)
public boolean startPriority(java.lang.Runnable task, long timeout)
public void reset()
public void closeEnvironment(java.lang.ClassLoader env)
public void interrupt()
public void close()
public java.lang.String toString()
toString
in class java.lang.Object