executor = new ThreadPoolExecutor(getMinSpareThreads(), getMaxThreads(), maxIdleTime, TimeUnit.MILLISECONDS,taskqueue, tf) {
@Override
protected void afterExecute(Runnable r, Throwable t) {
AtomicInteger atomic = submittedTasksCount;
if(atomic!=null) {
atomic.decrementAndGet();
}
}
};
taskqueue.setParent( (ThreadPoolExecutor) executor);
submittedTasksCount = new AtomicInteger();