Class CPMExecutorService
- java.lang.Object
-
- java.util.concurrent.AbstractExecutorService
-
- java.util.concurrent.ThreadPoolExecutor
-
- org.apache.uima.collection.impl.cpm.engine.CPMExecutorService
-
- All Implemented Interfaces:
java.util.concurrent.Executor,java.util.concurrent.ExecutorService
public class CPMExecutorService extends java.util.concurrent.ThreadPoolExecutorThis component catches uncaught errors in the CPM. All critical threads in the CPM are part of this executor service. If OutOfMemory Error is thrown this component is notified by the JVM and its job is to notify registered listeners.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classCPMExecutorService.CpmFutureTask<T>-
Nested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor
java.util.concurrent.ThreadPoolExecutor.AbortPolicy, java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardOldestPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardPolicy
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<BaseStatusCallbackListener>callbackListenersprivate ProcessTraceprocTr
-
Constructor Summary
Constructors Constructor Description CPMExecutorService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidafterExecute(java.lang.Runnable aThread, java.lang.Throwable aThrowable)voidcleanup()Cleanup.protected <T> java.util.concurrent.RunnableFuture<T>newTaskFor(java.lang.Runnable aRunnable, T aValue)protected <T> java.util.concurrent.RunnableFuture<T>newTaskFor(java.util.concurrent.Callable<T> aCallable)private voidnotifyListener(BaseStatusCallbackListener aStatCL, java.lang.Throwable e)Notify listener.voidsetListeners(java.util.List<BaseStatusCallbackListener> aListenerList)Sets listeners to be used in notifications.voidsetProcessTrace(ProcessTrace aProcessTrace)Sets the process trace.-
Methods inherited from class java.util.concurrent.ThreadPoolExecutor
allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, beforeExecute, 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, terminated, toString
-
-
-
-
Field Detail
-
callbackListeners
private java.util.List<BaseStatusCallbackListener> callbackListeners
-
procTr
private ProcessTrace procTr
-
-
Method Detail
-
setListeners
public void setListeners(java.util.List<BaseStatusCallbackListener> aListenerList)
Sets listeners to be used in notifications.- Parameters:
aListenerList- list of registered listeners
-
setProcessTrace
public void setProcessTrace(ProcessTrace aProcessTrace)
Sets the process trace.- Parameters:
aProcessTrace- the new process trace
-
afterExecute
protected void afterExecute(java.lang.Runnable aThread, java.lang.Throwable aThrowable)- Overrides:
afterExecutein classjava.util.concurrent.ThreadPoolExecutor
-
notifyListener
private void notifyListener(BaseStatusCallbackListener aStatCL, java.lang.Throwable e)
Notify listener.- Parameters:
aStatCL- the a stat CLe- the e
-
cleanup
public void cleanup()
Cleanup.
-
newTaskFor
protected <T> java.util.concurrent.RunnableFuture<T> newTaskFor(java.util.concurrent.Callable<T> aCallable)
- Overrides:
newTaskForin classjava.util.concurrent.AbstractExecutorService
-
newTaskFor
protected <T> java.util.concurrent.RunnableFuture<T> newTaskFor(java.lang.Runnable aRunnable, T aValue)- Overrides:
newTaskForin classjava.util.concurrent.AbstractExecutorService
-
-