public class ProcessExecutor extends ThreadPoolExecutor implements ProcessEventListener
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy| Constructor and Description |
|---|
ProcessExecutor()
The default constructor creates a fixed-sized thread-pool with
corePoolSize == maximumPoolSize.
|
ProcessExecutor(int pProcs)
Create a ProcessExecutor with given number of threads for
corePoolSize and maximumPoolSize.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
afterExecute(Runnable r,
Throwable t)
Deregister this ProcessExecutor as a
ProcessEventListener. |
protected void |
beforeExecute(Thread t,
Runnable r)
Register this ProcessExecutor as a
ProcessEventListener. |
void |
destroy()
Destroy all active processes.
|
void |
processInitiated(ProcessEvent pEvent)
This method is called at process initiation.
|
void |
processStarted(ProcessEvent pEvent)
This method is called at process startup.
|
void |
processTerminated(ProcessEvent pEvent)
This method is called at normal or abnormal process termination.
|
List<Runnable> |
shutdownNow() |
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, terminated, toStringinvokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submitpublic ProcessExecutor()
public ProcessExecutor(int pProcs)
pProcs - Number of concurrently executing processes.protected void beforeExecute(Thread t, Runnable r)
ProcessEventListener.
beforeExecute in class ThreadPoolExecutorprotected void afterExecute(Runnable r, Throwable t)
ProcessEventListener.
afterExecute in class ThreadPoolExecutorpublic void processInitiated(ProcessEvent pEvent)
processInitiated in interface ProcessEventListenerpublic void processStarted(ProcessEvent pEvent)
processStarted in interface ProcessEventListenerpublic void processTerminated(ProcessEvent pEvent)
processTerminated in interface ProcessEventListenerpublic List<Runnable> shutdownNow()
shutdownNow in interface ExecutorServiceshutdownNow in class ThreadPoolExecutorpublic void destroy()
Copyright © 2019. All rights reserved.