Class MonitoredThreadPoolTaskScheduler

  • All Implemented Interfaces:
    java.io.Serializable, java.util.concurrent.Executor, java.util.concurrent.ThreadFactory, 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.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:
    ThreadPoolTaskScheduler, ExecutorServiceMetrics, TimedScheduledExecutorService, Serialized Form
    • Field Summary

      • Fields inherited from class org.springframework.scheduling.concurrent.ExecutorConfigurationSupport

        logger
      • Fields inherited from interface org.springframework.core.task.AsyncTaskExecutor

        TIMEOUT_IMMEDIATE, TIMEOUT_INDEFINITE
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void afterSingletonsInstantiated()  
      protected java.util.concurrent.ScheduledExecutorService createExecutor​(int poolSize, java.util.concurrent.ThreadFactory threadFactory, java.util.concurrent.RejectedExecutionHandler rejectedExecutionHandler)  
      java.util.concurrent.ScheduledExecutorService getScheduledExecutor()  
      void setApplicationContext​(org.springframework.context.ApplicationContext applicationContext)  
      void setBeanName​(java.lang.String name)  
      • Methods inherited from class org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler

        cancelRemainingTask, execute, execute, getActiveCount, getClock, getPoolSize, getScheduledThreadPoolExecutor, initializeExecutor, isRemoveOnCancelPolicy, schedule, schedule, scheduleAtFixedRate, scheduleAtFixedRate, scheduleWithFixedDelay, scheduleWithFixedDelay, setClock, setContinueExistingPeriodicTasksAfterShutdownPolicy, setErrorHandler, setExecuteExistingDelayedTasksAfterShutdownPolicy, setPoolSize, setRemoveOnCancelPolicy, submit, submit, submitListenable, submitListenable
      • Methods inherited from class org.springframework.scheduling.concurrent.ExecutorConfigurationSupport

        afterPropertiesSet, destroy, initialize, setAwaitTerminationMillis, setAwaitTerminationSeconds, setRejectedExecutionHandler, setThreadFactory, setThreadNamePrefix, setWaitForTasksToCompleteOnShutdown, shutdown
      • Methods inherited from class org.springframework.scheduling.concurrent.CustomizableThreadFactory

        newThread
      • Methods inherited from class org.springframework.util.CustomizableThreadCreator

        createThread, getDefaultThreadNamePrefix, getThreadGroup, getThreadNamePrefix, getThreadPriority, isDaemon, nextThreadName, setDaemon, setThreadGroup, setThreadGroupName, setThreadPriority
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.springframework.scheduling.SchedulingTaskExecutor

        prefersShortLivedTasks
      • Methods inherited from interface org.springframework.scheduling.TaskScheduler

        schedule, scheduleAtFixedRate, scheduleAtFixedRate, scheduleWithFixedDelay, scheduleWithFixedDelay
    • Constructor Detail

      • MonitoredThreadPoolTaskScheduler

        public MonitoredThreadPoolTaskScheduler()
    • Method Detail

      • createExecutor

        protected java.util.concurrent.ScheduledExecutorService createExecutor​(int poolSize,
                                                                               java.util.concurrent.ThreadFactory threadFactory,
                                                                               java.util.concurrent.RejectedExecutionHandler rejectedExecutionHandler)
        Overrides:
        createExecutor in class org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
      • getScheduledExecutor

        public java.util.concurrent.ScheduledExecutorService getScheduledExecutor()
                                                                           throws java.lang.IllegalStateException
        Overrides:
        getScheduledExecutor in class org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
        Throws:
        java.lang.IllegalStateException
      • afterSingletonsInstantiated

        public void afterSingletonsInstantiated()
        Specified by:
        afterSingletonsInstantiated in interface org.springframework.beans.factory.SmartInitializingSingleton
      • setBeanName

        public void setBeanName​(java.lang.String name)
        Specified by:
        setBeanName in interface org.springframework.beans.factory.BeanNameAware
        Overrides:
        setBeanName in class org.springframework.scheduling.concurrent.ExecutorConfigurationSupport
      • setApplicationContext

        public void setApplicationContext​(org.springframework.context.ApplicationContext applicationContext)
                                   throws org.springframework.beans.BeansException
        Specified by:
        setApplicationContext in interface org.springframework.context.ApplicationContextAware
        Throws:
        org.springframework.beans.BeansException