Class CPMExecutorService

All Implemented Interfaces:
AutoCloseable, Executor, ExecutorService

public class CPMExecutorService extends ThreadPoolExecutor
This 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.
  • Constructor Details

    • CPMExecutorService

      public CPMExecutorService()
  • Method Details

    • setContextClassLoader

      public void setContextClassLoader(ClassLoader aClassLoader)
      Sets the thread context class loader (TCCL) that the worker threads should run under. This is applied to each task individually (and restored afterwards), so that pooled worker threads - which may carry a stale TCCL from an earlier, unrelated task - run the CPM work under the loader captured from the control thread that started the processing (see issue #254). A null value (the default) leaves the worker threads' TCCL untouched.
      Parameters:
      aClassLoader - the class loader to use as the worker threads' TCCL, or null to leave it unchanged
    • setListeners

      public void setListeners(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(Runnable aThread, Throwable aThrowable)
      Overrides:
      afterExecute in class ThreadPoolExecutor
    • cleanup

      public void cleanup()
      Cleanup.
    • terminated

      protected void terminated()
      Overrides:
      terminated in class ThreadPoolExecutor
    • newTaskFor

      protected <T> RunnableFuture<T> newTaskFor(Callable<T> aCallable)
      Overrides:
      newTaskFor in class AbstractExecutorService
    • newTaskFor

      protected <T> RunnableFuture<T> newTaskFor(Runnable aRunnable, T aValue)
      Overrides:
      newTaskFor in class AbstractExecutorService