com.jaxfront.core.util
Class ThreadPool
java.lang.Object
com.jaxfront.core.util.ThreadPool
public class ThreadPool
- extends java.lang.Object
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ThreadPool
public ThreadPool()
ThreadPool
public ThreadPool(int corePoolSize,
int maxPoolSize,
long keepAliveTime)
getInstance
public static ThreadPool getInstance()
init
public static void init(int corePoolSize,
int maxPoolSize,
long keepAliveTime)
main
public static void main(java.lang.String[] args)
release
public void release()
runTask
public void runTask(java.lang.Runnable task)
- Here we add our jobs to working queue
- Parameters:
task - a Runnable task
setCorePoolSize
public void setCorePoolSize(int corePoolSize)
setKeepAliveTime
public void setKeepAliveTime(long keepAliveTime)
setMaxPoolSize
public void setMaxPoolSize(int maxPoolSize)
shutDown
public void shutDown()
- Shutdown the Threadpool if it's finished