Code examples for ThreadPoolExecutor

Codota analyzed 7,668,838 open source code samples to find the most common, credible and clear examples.
You can now enable Codota on your own code to easily search and navigate your Java codebase.
71:	LOG.debug("Current active thread number: " + executor.getActiveCount() 
72:	+ " queue size:" + executor.getQueue().size() 
73:	+ " scheduled task number:" + executor.getTaskCount()); 
-
75:	executor.execute(task); 
Full Snippet Info
8
CodeRank
40:	BlockingQueue<Runnable> queue = executor.getQueue(); 
-
54:	if (executor.isShutdown()) { 
-
57:	if (executor.getQueue() instanceof SizeBlockingQueue) { 
58:	sb.append("(queue capacity ").append(((SizeBlockingQueue) executor.getQueue()).capacity()).append(") "); 
Full Snippet Info
8
CodeRank
87:	final ThreadPoolExecutor executorService = new ThreadPoolExecutor(POOL_CORE_SIZE, POOL_MAX_SIZE, 
-
91:	executorService.allowCoreThreadTimeOut(true); 
92:	getExecutorInjector().inject(executorService); 
Full Snippet Info
8
CodeRank
109:	executor.shutdown(); 
110:	if (!executor.awaitTermination(60, TimeUnit.SECONDS)) { 
111:	executor.shutdownNow(); 
Full Snippet Info
8
CodeRank
51:	return executor.getPoolSize() - executor.getActiveCount(); 
Full Snippet Info
7
CodeRank
59:	this.getExecutor.shutdown(); 
-
66:	this.getExecutor.awaitTermination(5000, TimeUnit.MILLISECONDS); 
Full Snippet Info
7
CodeRank
49:	threadName, e.getPoolSize(), e.getActiveCount(), e.getCorePoolSize(), e.getMaximumPoolSize(), e.getLargestPoolSize(), 
50:	e.getTaskCount(), e.getCompletedTaskCount(), e.isShutdown(), e.isTerminated(), e.isTerminating(), 
Full Snippet Info
7
CodeRank
39:	BlockingQueue<Runnable> queue = executor.getQueue(); 
-
54:	if (executor.isShutdown()) { 
-
57:	if (executor.getQueue() instanceof SizeBlockingQueue) { 
58:	sb.append("(queue capacity ").append(((SizeBlockingQueue) executor.getQueue()).capacity()).append(") "); 
Full Snippet Info
7
CodeRank
54:	long completed = executor.getCompletedTaskCount(); 
-
64:	now - last_change, executor.getCorePoolSize(), executor.getMaximumPoolSize(), 
65:	executor.getPoolSize(), executor.getActiveCount(), executor.getLargestPoolSize(), 
66:	executor.getCompletedTaskCount(), executor.getTaskCount()); 
-
74:	fallback.rejectedExecution(r, executor); 
Full Snippet Info
7
CodeRank
34:	". activeCount=" + executor.getActiveCount() + 
35:	". corePoolSize=" + executor.getCorePoolSize() + 
36:	". poolSize=" + executor.getPoolSize() + 
37:	". maxPoolSize=" + executor.getMaximumPoolSize() + 
38:	". queueSize=" + executor.getQueue().size() + 
39:	". taskCount=" + executor.getTaskCount() + 
40:	". completedTaskCount=" + executor.getCompletedTaskCount() 
Full Snippet Info
7
CodeRank
246:	return this.threadPoolExecutor.getActiveCount(); 
Full Snippet Info
7
CodeRank
111:	return tpe.getPoolSize() == tpe.getMaximumPoolSize() && 
112:	tpe.getQueue().size() >= tpe.getPoolSize() - tpe.getActiveCount(); 
Full Snippet Info
7
CodeRank
112:	threadPool.getActiveCount(), 
113:	threadPool.getPoolSize(), 
114:	threadPool.getTaskCount(), 
115:	threadPool.getCompletedTaskCount(), 
116:	threadPool.getQueue().size(), 
Full Snippet Info
7
CodeRank
36:	return new ThreadPoolExecutor(4, 4, 30L, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(256), threadFactory); 
Full Snippet Info
7
CodeRank
49:	assertEquals(1, tp.getCorePoolSize()); 
50:	assertEquals(5, tp.getMaximumPoolSize()); 
-
52:	assertEquals(60, tp.getKeepAliveTime(TimeUnit.SECONDS)); 
53:	assertEquals("CallerRuns", tp.getRejectedExecutionHandler().toString()); 
Full Snippet Info
7
CodeRank
147:	return threadPool.getCorePoolSize(); 
Full Snippet Info
7
CodeRank
173:	return tpe.getPoolSize() == tpe.getMaximumPoolSize() && 
174:	tpe.getQueue().size() >= tpe.getPoolSize() - tpe.getActiveCount(); 
Full Snippet Info
7
CodeRank
173:	return tpe.getPoolSize() == tpe.getMaximumPoolSize() && 
174:	tpe.getQueue().size() >= tpe.getPoolSize() - tpe.getActiveCount(); 
Full Snippet Info
7
CodeRank
60:	return new ThreadPoolExecutor(4, 4, 30L, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(256), threadFactory); 
Full Snippet Info
7
CodeRank
113:	executor.shutdown(); 
114:	if (!executor.awaitTermination(60,TimeUnit.SECONDS)) 
115:	executor.shutdownNow(); 
Full Snippet Info
7
CodeRank