| |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Implements a pool of Threads - enables multiple threads to be used within an apllication without the associated overhead of starting new Threads, since Threads are re-used
Inner Class Summary | |
public static class | ThreadPool.Job Interface to be implemented by objects to be executed by threads within a ThreadPool |
public class | ThreadPool.TPThread Extends Thread to provide the ThreadGroup of the thread that requested the Job be carried out |
Constructor Summary | |
ThreadPool(int number_of_threads, String name) Create a thread pool with the specified number of threads, and a name to use as a prefix for the thread names |
Method Summary | |
synchronized void | addJob(Job job) Add a Job to be executed by the ThreadPool |
synchronized int | getActiveThreadCount() Get the number of active threads |
static synchronized ThreadPool | getGlobalThreadPool() Get the global thread-pool |
String | getName() Get the name of the thread pool |
int | getThreadCount() Get the number of threads |
static Set | getThreadPools() Get a set of all thread-pools |
synchronized long | getTotalActiveTime() Get the number of active threads |
synchronized long | getTotalInactiveTime() Get the number of threads |
int | getWaitingJobCount() Get the number of waiting Jobs |
static void | main(String[] args) Test harness |
void | run() Invoked by each thread in the ThreadPool |
synchronized void | shutdown() Terminate all threads & stop executing pending jobs - doesn't block |
String | toString() Returns name of ThreadPool |
Constructor Detail |
public ThreadPool(int number_of_threads, String name)
Method Detail |
public synchronized void addJob(Job job)
public synchronized int getActiveThreadCount()
public static synchronized ThreadPool getGlobalThreadPool()
public String getName()
public int getThreadCount()
public static Set getThreadPools()
public synchronized long getTotalActiveTime()
public synchronized long getTotalInactiveTime()
public int getWaitingJobCount()
public static void main(String[] args)
public void run()
public synchronized void shutdown()
public String toString()
Association Links |
to Class java.util.Set
to Class java.util.List
to Class fipaos.util.Queue
to Class java.lang.String
| |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |