@InterfaceAudience.Public @InterfaceStability.Evolving public class GlobalThread extends SafeThread
SafeThread instance.getGlobalThread(int) to Initialize the the thread with the
specified number of threads. Otherwise it uses
Executors.newCachedThreadPool() and creates number of the threads on
demand.| Modifier and Type | Method and Description |
|---|---|
static GlobalThread |
getGlobalThread()
Gets the singleton
SafeThread. |
static GlobalThread |
getGlobalThread(int noOfThreads)
Gets the singleton
SafeThread. |
static GlobalThread |
getGlobalThread(int minNoOfThreads,
int maxNoOfThreads)
Gets the singleton
SafeThread. |
addTimerTaskListener, getInterval, getListeners, isRunning, onTimerTask, removeTimerTaskListener, run, setInterval, shutdown, start, stoppublic static GlobalThread getGlobalThread(int minNoOfThreads, int maxNoOfThreads)
SafeThread. Instantiates the
GlobalThread if not done so far with the number of threads, else
returns the existing one.ThreadPoolExecutor.ThreadPoolExecutor(int, int, long, TimeUnit, java.util.concurrent.BlockingQueue) to create the
threads on demand.minNoOfThreads - the min no of threadsmaxNoOfThreads - the max no of threadspublic static GlobalThread getGlobalThread(int noOfThreads)
SafeThread. Instantiates the
GlobalThread if not done so far with the number of threads, else
returns the existing one.Executors.newFixedThreadPool(int) to
create the threads on demand.noOfThreads - the no of threadspublic static GlobalThread getGlobalThread()
SafeThread. Instantiates the
GlobalThread if not done so far with the number of threads, else
returns the existing one.Executors.newCachedThreadPool() to create the
threads on demand.Copyright © 2016 utils4j. All Rights Reserved.