private ThreadFactory getThreadFactory(ExecutorService threadPool) { if (threadPool instanceof ExtendedThreadPool) { return ((ExtendedThreadPool) threadPool).getThreadFactory(); } else if (threadPool instanceof ThreadPoolExecutor) { return ((ThreadPoolExecutor) threadPool).getThreadFactory(); } return null; }
@SuppressWarnings("deprecation") protected ThreadPoolConfig updateFrom(ExtendedThreadPool ep) { this.queue = ep.getQueue(); this.threadFactory = ep.getThreadFactory(); this.poolName = ep.getName(); this.maxPoolSize = ep.getMaximumPoolSize(); //hiding internal values, due to they might not match configure //this.queueLimit = ep.getMaxQueuedTasksCount(); //this.corepoolsize = ep.getCorePoolSize(); //this.keepAliveTime = keepAliveTime; //this.timeUnit = timeUnit; //this.monitoringProbe = monitoringProbe; return this; }