public class ThreadReuseExecutor extends Object implements TeiidExecutor
SynchronousQueue
based ThreadPoolExecutor
satisfies 1 and 2, but not 3.
A bounded or unbound queue based ThreadPoolExecutor
allows for 3, but will tend to create
up to the maximum number of threads and makes no guarantee on thread scheduling.
SynchronousQueue
backed ThreadPoolExecutor
.
Modifier and Type | Class and Description |
---|---|
static interface |
ThreadReuseExecutor.PrioritizedRunnable |
static class |
ThreadReuseExecutor.RunnableWrapper |
Constructor and Description |
---|
ThreadReuseExecutor(String name,
int maximumPoolSize) |
Modifier and Type | Method and Description |
---|---|
boolean |
awaitTermination(long timeout,
TimeUnit unit) |
void |
execute(Runnable command) |
int |
getActiveCount() |
int |
getCompletedCount() |
int |
getLargestPoolSize() |
int |
getPoolSize() |
WorkerPoolStatisticsMetadata |
getStats() |
int |
getSubmittedCount() |
boolean |
hasWork() |
boolean |
isTerminated() |
protected void |
logWaitMessage(long warnTime,
int maximumPoolSize,
String poolName,
int highestQueueSize) |
void |
shutdown() |
List<Runnable> |
shutdownNow() |
public ThreadReuseExecutor(String name, int maximumPoolSize)
public void execute(Runnable command)
execute
in interface Executor
execute
in interface TeiidExecutor
protected void logWaitMessage(long warnTime, int maximumPoolSize, String poolName, int highestQueueSize)
public int getActiveCount()
public int getSubmittedCount()
public int getCompletedCount()
public int getPoolSize()
public boolean isTerminated()
public void shutdown()
public int getLargestPoolSize()
public WorkerPoolStatisticsMetadata getStats()
getStats
in interface TeiidExecutor
public boolean hasWork()
public List<Runnable> shutdownNow()
shutdownNow
in interface TeiidExecutor
public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException
awaitTermination
in interface TeiidExecutor
InterruptedException
Copyright © 2018 JBoss by Red Hat. All rights reserved.