Class MonitoredThreadPoolTaskScheduler
java.lang.Object
org.springframework.util.CustomizableThreadCreator
org.springframework.scheduling.concurrent.CustomizableThreadFactory
org.springframework.scheduling.concurrent.ExecutorConfigurationSupport
org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
io.microsphere.spring.boot.actuate.MonitoredThreadPoolTaskScheduler
- All Implemented Interfaces:
Serializable,Executor,ThreadFactory,EventListener,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean,org.springframework.beans.factory.SmartInitializingSingleton,org.springframework.context.ApplicationContextAware,org.springframework.context.ApplicationListener<org.springframework.context.event.ContextClosedEvent>,org.springframework.context.Lifecycle,org.springframework.context.Phased,org.springframework.context.SmartLifecycle,org.springframework.core.task.AsyncListenableTaskExecutor,org.springframework.core.task.AsyncTaskExecutor,org.springframework.core.task.TaskExecutor,org.springframework.scheduling.SchedulingTaskExecutor,org.springframework.scheduling.TaskScheduler
public class MonitoredThreadPoolTaskScheduler
extends org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
implements org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.SmartInitializingSingleton
ThreadPoolTaskScheduler with ExecutorServiceMetrics features- Since:
- 1.0.0
- Author:
- Mercy
- See Also:
-
ThreadPoolTaskSchedulerExecutorServiceMetricsTimedScheduledExecutorService- Serialized Form
-
Field Summary
Fields inherited from class org.springframework.scheduling.concurrent.ExecutorConfigurationSupport
DEFAULT_PHASE, loggerFields inherited from interface org.springframework.core.task.AsyncTaskExecutor
TIMEOUT_IMMEDIATE, TIMEOUT_INDEFINITE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected ScheduledExecutorServicecreateExecutor(int poolSize, ThreadFactory threadFactory, RejectedExecutionHandler rejectedExecutionHandler) voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidsetBeanName(String name) Methods inherited from class org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
cancelRemainingTask, execute, getActiveCount, getClock, getPoolSize, getScheduledThreadPoolExecutor, initializeExecutor, isRemoveOnCancelPolicy, schedule, schedule, scheduleAtFixedRate, scheduleAtFixedRate, scheduleWithFixedDelay, scheduleWithFixedDelay, setClock, setContinueExistingPeriodicTasksAfterShutdownPolicy, setErrorHandler, setExecuteExistingDelayedTasksAfterShutdownPolicy, setPoolSize, setRemoveOnCancelPolicy, setTaskDecorator, submit, submit, submitListenable, submitListenableMethods inherited from class org.springframework.scheduling.concurrent.ExecutorConfigurationSupport
afterExecute, afterPropertiesSet, beforeExecute, destroy, getPhase, initialize, initiateEarlyShutdown, initiateShutdown, isRunning, onApplicationEvent, setAcceptTasksAfterContextClose, setAwaitTerminationMillis, setAwaitTerminationSeconds, setPhase, setRejectedExecutionHandler, setThreadFactory, setThreadNamePrefix, setVirtualThreads, setWaitForTasksToCompleteOnShutdown, shutdown, start, stop, stopMethods inherited from class org.springframework.scheduling.concurrent.CustomizableThreadFactory
newThreadMethods inherited from class org.springframework.util.CustomizableThreadCreator
createThread, getDefaultThreadNamePrefix, getThreadGroup, getThreadNamePrefix, getThreadPriority, isDaemon, nextThreadName, setDaemon, setThreadGroup, setThreadGroupName, setThreadPriorityMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationListener
supportsAsyncExecutionMethods inherited from interface org.springframework.core.task.AsyncTaskExecutor
execute, submitCompletable, submitCompletableMethods inherited from interface org.springframework.scheduling.SchedulingTaskExecutor
prefersShortLivedTasksMethods inherited from interface org.springframework.context.SmartLifecycle
isAutoStartupMethods inherited from interface org.springframework.scheduling.TaskScheduler
schedule, scheduleAtFixedRate, scheduleAtFixedRate, scheduleWithFixedDelay, scheduleWithFixedDelay
-
Constructor Details
-
MonitoredThreadPoolTaskScheduler
public MonitoredThreadPoolTaskScheduler()
-
-
Method Details
-
createExecutor
protected ScheduledExecutorService createExecutor(int poolSize, ThreadFactory threadFactory, RejectedExecutionHandler rejectedExecutionHandler) - Overrides:
createExecutorin classorg.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
-
getScheduledExecutor
- Overrides:
getScheduledExecutorin classorg.springframework.scheduling.concurrent.ThreadPoolTaskScheduler- Throws:
IllegalStateException
-
afterSingletonsInstantiated
public void afterSingletonsInstantiated()- Specified by:
afterSingletonsInstantiatedin interfaceorg.springframework.beans.factory.SmartInitializingSingleton
-
setBeanName
- Specified by:
setBeanNamein interfaceorg.springframework.beans.factory.BeanNameAware- Overrides:
setBeanNamein classorg.springframework.scheduling.concurrent.ExecutorConfigurationSupport
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Overrides:
setApplicationContextin classorg.springframework.scheduling.concurrent.ExecutorConfigurationSupport- Throws:
org.springframework.beans.BeansException
-