public class ShutdownStreamOnUnhandleThrowableThreadPoolExecutor extends ThreadPoolExecutor
java.util.concurrent.ThreadPoolExecutor}
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy
Constructor and Description |
---|
ShutdownStreamOnUnhandleThrowableThreadPoolExecutor(int numThreads,
LocalStreamBuilder streamBuilder)
Creates a fixed size thread pool where corePoolSize & maximumPoolSize equal numThreads with an unbounded queue.
|
Modifier and Type | Method and Description |
---|---|
protected void |
afterExecute(Runnable r,
Throwable t) |
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
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submit
public ShutdownStreamOnUnhandleThrowableThreadPoolExecutor(int numThreads, LocalStreamBuilder streamBuilder)
numThreads
- number of threads in poolstreamBuilder
- streambuilder to call StreamBuilder.stop()
on upon receiving an unhandled throwableprotected void afterExecute(Runnable r, Throwable t)
afterExecute
in class ThreadPoolExecutor
Copyright © 2012–2016 The Apache Software Foundation. All rights reserved.