Class JBossScheduledThreadPoolExecutor
java.lang.Object
java.util.concurrent.AbstractExecutorService
java.util.concurrent.ThreadPoolExecutor
java.util.concurrent.ScheduledThreadPoolExecutor
org.jboss.threads.JBossScheduledThreadPoolExecutor
- All Implemented Interfaces:
Executor, ExecutorService, ScheduledExecutorService, ThreadExecutorMBean, ThreadPoolExecutorMBean, ShutdownListenable
public final class JBossScheduledThreadPoolExecutor
extends ScheduledThreadPoolExecutor
implements ThreadPoolExecutorMBean, ShutdownListenable
-
Nested Class Summary
Nested classes/interfaces inherited from class ThreadPoolExecutor
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy -
Constructor Summary
ConstructorsConstructorDescriptionJBossScheduledThreadPoolExecutor(int corePoolSize) JBossScheduledThreadPoolExecutor(int corePoolSize, RejectedExecutionHandler handler) JBossScheduledThreadPoolExecutor(int corePoolSize, ThreadFactory threadFactory) JBossScheduledThreadPoolExecutor(int corePoolSize, ThreadFactory threadFactory, RejectedExecutionHandler handler) -
Method Summary
Modifier and TypeMethodDescription<A> voidaddShutdownListener(EventListener<A> shutdownListener, A attachment) Add a shutdown listener.intlongintintintintvoidsetKeepAliveTime(long milliseconds) voidsetKeepAliveTime(long time, TimeUnit unit) voidsetMaxThreads(int newSize) voidprotected voidMethods inherited from class ScheduledThreadPoolExecutor
decorateTask, decorateTask, execute, getContinueExistingPeriodicTasksAfterShutdownPolicy, getExecuteExistingDelayedTasksAfterShutdownPolicy, getQueue, getRemoveOnCancelPolicy, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, setContinueExistingPeriodicTasksAfterShutdownPolicy, setExecuteExistingDelayedTasksAfterShutdownPolicy, setRemoveOnCancelPolicy, shutdown, shutdownNow, submit, submit, submitMethods inherited from class ThreadPoolExecutor
afterExecute, allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, beforeExecute, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setMaximumPoolSize, setThreadFactory, toStringMethods inherited from class AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskForMethods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ExecutorService
awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated
-
Constructor Details
-
JBossScheduledThreadPoolExecutor
public JBossScheduledThreadPoolExecutor(int corePoolSize) -
JBossScheduledThreadPoolExecutor
-
JBossScheduledThreadPoolExecutor
-
JBossScheduledThreadPoolExecutor
public JBossScheduledThreadPoolExecutor(int corePoolSize, ThreadFactory threadFactory, RejectedExecutionHandler handler)
-
-
Method Details
-
getKeepAliveTime
public long getKeepAliveTime()- Specified by:
getKeepAliveTimein interfaceThreadPoolExecutorMBean
-
setKeepAliveTime
public void setKeepAliveTime(long milliseconds) - Specified by:
setKeepAliveTimein interfaceThreadPoolExecutorMBean
-
setKeepAliveTime
- Overrides:
setKeepAliveTimein classThreadPoolExecutor
-
getRejectedCount
public int getRejectedCount()- Specified by:
getRejectedCountin interfaceThreadExecutorMBean
-
getCurrentThreadCount
public int getCurrentThreadCount()- Specified by:
getCurrentThreadCountin interfaceThreadExecutorMBean
-
getLargestThreadCount
public int getLargestThreadCount()- Specified by:
getLargestThreadCountin interfaceThreadExecutorMBean
-
getMaxThreads
public int getMaxThreads()- Specified by:
getMaxThreadsin interfaceThreadPoolExecutorMBean
-
setMaxThreads
public void setMaxThreads(int newSize) - Specified by:
setMaxThreadsin interfaceThreadPoolExecutorMBean
-
getRejectedExecutionHandler
- Overrides:
getRejectedExecutionHandlerin classThreadPoolExecutor
-
setRejectedExecutionHandler
- Overrides:
setRejectedExecutionHandlerin classThreadPoolExecutor
-
getQueueSize
public int getQueueSize()- Specified by:
getQueueSizein interfaceThreadExecutorMBean
-
addShutdownListener
Add a shutdown listener. If the target object is already shut down, the listener is invoked directly.- Specified by:
addShutdownListenerin interfaceShutdownListenable- Type Parameters:
A- the attachment type- Parameters:
shutdownListener- the listenerattachment- the attachment value to pass to the listener
-
terminated
protected void terminated()- Overrides:
terminatedin classThreadPoolExecutor
-