public final class LocalExecutorService
extends java.util.concurrent.ThreadPoolExecutor
java.util.concurrent.ThreadPoolExecutor.AbortPolicy, java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardOldestPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardPolicy
Modifier and Type | Field and Description |
---|---|
private static LocalExecutorService |
INSTANCE |
private static org.apache.log4j.Logger |
log |
private java.util.concurrent.atomic.AtomicLong |
numTasks |
private java.lang.ThreadLocal<java.lang.Long> |
startTime |
private static java.lang.String |
threadNumPropName |
private java.util.concurrent.atomic.AtomicLong |
totalTime |
Modifier | Constructor and Description |
---|---|
private |
LocalExecutorService(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
java.util.concurrent.TimeUnit unit,
java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue) |
Modifier and Type | Method and Description |
---|---|
protected void |
afterExecute(java.lang.Runnable r,
java.lang.Throwable t) |
protected void |
beforeExecute(java.lang.Thread t,
java.lang.Runnable r) |
boolean |
canAcceptMoreWork()
If the Executor queue is empty
|
static LocalExecutorService |
getExecutor()
This method returns the single instance of CachedThreadPoolExecutor which
it cashes internally
|
private static LocalExecutorService |
init() |
static void |
shutDown()
This stops all executing processes via interruption.
|
protected void |
terminated() |
allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, execute, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, shutdown, shutdownNow, toString
private static final org.apache.log4j.Logger log
private static final java.lang.String threadNumPropName
private static LocalExecutorService INSTANCE
private final java.lang.ThreadLocal<java.lang.Long> startTime
private final java.util.concurrent.atomic.AtomicLong numTasks
private final java.util.concurrent.atomic.AtomicLong totalTime
private LocalExecutorService(int corePoolSize, int maximumPoolSize, long keepAliveTime, java.util.concurrent.TimeUnit unit, java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue)
public static LocalExecutorService getExecutor()
private static LocalExecutorService init()
public static void shutDown()
public boolean canAcceptMoreWork()
protected void beforeExecute(java.lang.Thread t, java.lang.Runnable r)
beforeExecute
in class java.util.concurrent.ThreadPoolExecutor
protected void afterExecute(java.lang.Runnable r, java.lang.Throwable t)
afterExecute
in class java.util.concurrent.ThreadPoolExecutor
protected void terminated()
terminated
in class java.util.concurrent.ThreadPoolExecutor