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:
  • Field Summary

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

    DEFAULT_PHASE, logger

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

    TIMEOUT_IMMEDIATE, TIMEOUT_INDEFINITE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    createExecutor(int poolSize, ThreadFactory threadFactory, RejectedExecutionHandler rejectedExecutionHandler)
     
     
    void
    setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
     
    void
     

    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, submitListenable

    Methods 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, stop

    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.context.ApplicationListener

    supportsAsyncExecution

    Methods inherited from interface org.springframework.core.task.AsyncTaskExecutor

    execute, submitCompletable, submitCompletable

    Methods inherited from interface org.springframework.scheduling.SchedulingTaskExecutor

    prefersShortLivedTasks

    Methods inherited from interface org.springframework.context.SmartLifecycle

    isAutoStartup

    Methods 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:
      createExecutor in class org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
    • getScheduledExecutor

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

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

      public void setBeanName(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
      Overrides:
      setApplicationContext in class org.springframework.scheduling.concurrent.ExecutorConfigurationSupport
      Throws:
      org.springframework.beans.BeansException