Package one.nio.server
Class WorkerPool
java.lang.Object
java.util.concurrent.AbstractExecutorService
java.util.concurrent.ThreadPoolExecutor
one.nio.server.WorkerPool
- All Implemented Interfaces:
AutoCloseable,Thread.UncaughtExceptionHandler,Executor,ExecutorService,ThreadFactory
final class WorkerPool
extends ThreadPoolExecutor
implements ThreadFactory, Thread.UncaughtExceptionHandler
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AtomicIntegerprivate static final org.slf4j.Loggerprivate final SchedulingPolicyprivate final int -
Constructor Summary
ConstructorsConstructorDescriptionWorkerPool(int minThreads, int maxThreads, long queueTime, int threadPriority, SchedulingPolicy schedulingPolicy) -
Method Summary
Modifier and TypeMethodDescription(package private) void(package private) voidsetQueueTime(long queueTime) voiduncaughtException(Thread t, Throwable e) Methods inherited from class java.util.concurrent.ThreadPoolExecutor
afterExecute, 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, toStringMethods inherited from class java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submitMethods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.concurrent.ExecutorService
close
-
Field Details
-
log
private static final org.slf4j.Logger log -
index
-
threadPriority
private final int threadPriority -
schedulingPolicy
-
-
Constructor Details
-
WorkerPool
WorkerPool(int minThreads, int maxThreads, long queueTime, int threadPriority, SchedulingPolicy schedulingPolicy)
-
-
Method Details
-
setQueueTime
void setQueueTime(long queueTime) -
gracefulShutdown
void gracefulShutdown() -
newThread
- Specified by:
newThreadin interfaceThreadFactory
-
uncaughtException
- Specified by:
uncaughtExceptionin interfaceThread.UncaughtExceptionHandler
-