public final class JBossThreadPoolExecutor extends java.util.concurrent.ThreadPoolExecutor implements BlockingExecutorService, BoundedQueueThreadPoolExecutorMBean, ShutdownListenable
| Modifier and Type | Class and Description |
|---|---|
private class |
JBossThreadPoolExecutor.CountingRejectHandler |
java.util.concurrent.ThreadPoolExecutor.AbortPolicy, java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardOldestPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardPolicy| Modifier and Type | Field and Description |
|---|---|
private java.util.concurrent.atomic.AtomicInteger |
rejectCount |
private SimpleShutdownListenable |
shutdownListenable |
| Constructor and Description |
|---|
JBossThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
java.util.concurrent.TimeUnit unit,
java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue) |
JBossThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
java.util.concurrent.TimeUnit unit,
java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue,
java.util.concurrent.RejectedExecutionHandler handler) |
JBossThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
java.util.concurrent.TimeUnit unit,
java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue,
java.util.concurrent.ThreadFactory threadFactory) |
JBossThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
java.util.concurrent.TimeUnit unit,
java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue,
java.util.concurrent.ThreadFactory threadFactory,
java.util.concurrent.RejectedExecutionHandler handler) |
| Modifier and Type | Method and Description |
|---|---|
<A> void |
addShutdownListener(EventListener<A> shutdownListener,
A attachment)
Add a shutdown listener.
|
void |
execute(java.lang.Runnable task)
Executes the given command at some time in the future.
|
void |
executeBlocking(java.lang.Runnable task)
Execute a task, blocking until it can be accepted, or until the calling thread is interrupted.
|
void |
executeBlocking(java.lang.Runnable task,
long timeout,
java.util.concurrent.TimeUnit unit)
Execute a task, blocking until it can be accepted, a timeout elapses, or the calling thread is interrupted.
|
void |
executeNonBlocking(java.lang.Runnable task)
Execute a task, without blocking.
|
int |
getCoreThreads() |
int |
getCurrentThreadCount() |
long |
getKeepAliveTime() |
int |
getLargestThreadCount() |
int |
getMaxThreads() |
int |
getQueueSize() |
int |
getRejectedCount() |
java.util.concurrent.RejectedExecutionHandler |
getRejectedExecutionHandler() |
boolean |
isAllowCoreThreadTimeout() |
boolean |
isBlocking() |
void |
setAllowCoreThreadTimeout(boolean allow) |
void |
setBlocking(boolean blocking) |
void |
setCoreThreads(int newSize) |
void |
setKeepAliveTime(long milliseconds) |
void |
setMaxThreads(int newSize) |
void |
setRejectedExecutionHandler(java.util.concurrent.RejectedExecutionHandler handler) |
protected void |
terminated() |
afterExecute, allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, beforeExecute, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setThreadFactory, shutdown, shutdownNow, toStringinvokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submitprivate final SimpleShutdownListenable shutdownListenable
private final java.util.concurrent.atomic.AtomicInteger rejectCount
public JBossThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
java.util.concurrent.TimeUnit unit,
java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue)
public JBossThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
java.util.concurrent.TimeUnit unit,
java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue,
java.util.concurrent.ThreadFactory threadFactory)
public JBossThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
java.util.concurrent.TimeUnit unit,
java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue,
java.util.concurrent.RejectedExecutionHandler handler)
public JBossThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
java.util.concurrent.TimeUnit unit,
java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue,
java.util.concurrent.ThreadFactory threadFactory,
java.util.concurrent.RejectedExecutionHandler handler)
public void execute(java.lang.Runnable task)
BlockingExecutorexecute in interface java.util.concurrent.Executorexecute in interface BlockingExecutorexecute in class java.util.concurrent.ThreadPoolExecutortask - the task to submitpublic void executeBlocking(java.lang.Runnable task)
throws java.util.concurrent.RejectedExecutionException,
java.lang.InterruptedException
BlockingExecutorexecuteBlocking in interface BlockingExecutortask - the task to submitStoppedExecutorException - if the executor was shut down before the task was acceptedThreadCreationException - if a thread could not be created for some reasonjava.util.concurrent.RejectedExecutionException - if execution is rejected for some other reasonjava.lang.InterruptedException - if the current thread was interrupted before the task could be acceptedpublic void executeBlocking(java.lang.Runnable task,
long timeout,
java.util.concurrent.TimeUnit unit)
throws java.util.concurrent.RejectedExecutionException,
java.lang.InterruptedException
BlockingExecutorexecuteBlocking in interface BlockingExecutortask - the task to submittimeout - the amount of time to waitunit - the unit of timeExecutionTimedOutException - if the timeout elapsed before a task could be acceptedStoppedExecutorException - if the executor was shut down before the task was acceptedThreadCreationException - if a thread could not be created for some reasonjava.util.concurrent.RejectedExecutionException - if execution is rejected for some other reasonjava.lang.InterruptedException - if the current thread was interrupted before the task could be acceptedpublic void executeNonBlocking(java.lang.Runnable task)
throws java.util.concurrent.RejectedExecutionException
BlockingExecutorexecuteNonBlocking in interface BlockingExecutortask - the task to submitStoppedExecutorException - if the executor was shut down before the task was acceptedThreadCreationException - if a thread could not be created for some reasonjava.util.concurrent.RejectedExecutionException - if execution is rejected for some other reasonpublic int getLargestThreadCount()
getLargestThreadCount in interface ThreadExecutorMBeanpublic boolean isAllowCoreThreadTimeout()
isAllowCoreThreadTimeout in interface BoundedQueueThreadPoolExecutorMBeanpublic void setAllowCoreThreadTimeout(boolean allow)
setAllowCoreThreadTimeout in interface BoundedQueueThreadPoolExecutorMBeanpublic int getMaxThreads()
getMaxThreads in interface ThreadPoolExecutorMBeanpublic void setMaxThreads(int newSize)
setMaxThreads in interface ThreadPoolExecutorMBeanpublic int getCoreThreads()
getCoreThreads in interface BoundedQueueThreadPoolExecutorMBeanpublic void setCoreThreads(int newSize)
setCoreThreads in interface BoundedQueueThreadPoolExecutorMBeanpublic long getKeepAliveTime()
getKeepAliveTime in interface ThreadPoolExecutorMBeanpublic void setKeepAliveTime(long milliseconds)
setKeepAliveTime in interface ThreadPoolExecutorMBeanpublic int getCurrentThreadCount()
getCurrentThreadCount in interface ThreadExecutorMBeanpublic int getRejectedCount()
getRejectedCount in interface ThreadExecutorMBeanpublic int getQueueSize()
getQueueSize in interface ThreadExecutorMBeanpublic boolean isBlocking()
isBlocking in interface BoundedThreadPoolExecutorMBeanpublic void setBlocking(boolean blocking)
setBlocking in interface BoundedThreadPoolExecutorMBeanpublic java.util.concurrent.RejectedExecutionHandler getRejectedExecutionHandler()
getRejectedExecutionHandler in class java.util.concurrent.ThreadPoolExecutorpublic void setRejectedExecutionHandler(java.util.concurrent.RejectedExecutionHandler handler)
setRejectedExecutionHandler in class java.util.concurrent.ThreadPoolExecutorpublic <A> void addShutdownListener(EventListener<A> shutdownListener, A attachment)
addShutdownListener in interface ShutdownListenableA - the attachment typeshutdownListener - the listenerattachment - the attachment value to pass to the listenerprotected void terminated()
terminated in class java.util.concurrent.ThreadPoolExecutor