public class ThreadPoolManager extends Object
Constructor and Description |
---|
ThreadPoolManager()
Create new thread pool manage.
|
ThreadPoolManager(int nThreads)
Create new thread pool manage.
|
ThreadPoolManager(int nThreads,
String name)
Create new thread pool manage.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Runnable runnable)
Add a new thread to the manager.
|
void |
shutdown()
Shutdown pool manager.
|
void |
shutdown(boolean now)
Shutdown pool manager.
|
static void |
shutdownAll()
Shutdown all created poll managers.
|
static void |
shutdownAll(boolean now)
Shutdown all created poll managers.
|
public ThreadPoolManager()
public ThreadPoolManager(int nThreads)
nThreads
- Number of concurrent threads.public ThreadPoolManager(int nThreads, String name)
nThreads
- Number of concurrent threads.name
- Name of the thread pool.public void add(Runnable runnable)
runnable
- The Runnable task to add.public void shutdown()
public void shutdown(boolean now)
now
- If the shutdown should be right now or can wait until all thread have finished.public static void shutdownAll()
public static void shutdownAll(boolean now)
now
- If the shutdown should be right now or can wait until all thread have finished.Copyright © 2017 Open Knowledge Management System S.L.. All rights reserved.