Package com.alipay.sofa.common.thread
Class SofaThreadPoolTaskScheduler
java.lang.Object
org.springframework.util.CustomizableThreadCreator
org.springframework.scheduling.concurrent.CustomizableThreadFactory
org.springframework.scheduling.concurrent.ExecutorConfigurationSupport
org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
com.alipay.sofa.common.thread.SofaThreadPoolTaskScheduler
- All Implemented Interfaces:
Serializable
,Executor
,ThreadFactory
,org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanNameAware
,org.springframework.beans.factory.DisposableBean
,org.springframework.beans.factory.InitializingBean
,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 SofaThreadPoolTaskScheduler
extends org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
Sofa thread pool based on
ThreadPoolTaskScheduler
- Version:
- SofaThreadPoolTaskScheduler.java, v 0.1 2020年11月09日 2:31 下午 huzijie Exp $
- Author:
- huzijie
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected long
static final String
protected SofaScheduledThreadPoolExecutor
protected String
protected long
protected String
Fields inherited from class org.springframework.scheduling.concurrent.ExecutorConfigurationSupport
logger
Fields inherited from interface org.springframework.core.task.AsyncTaskExecutor
TIMEOUT_IMMEDIATE, TIMEOUT_INDEFINITE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
long
long
protected ExecutorService
initializeExecutor
(ThreadFactory threadFactory, RejectedExecutionHandler rejectedExecutionHandler) void
setPeriod
(long period) void
setSpaceName
(String spaceName) void
setTaskTimeout
(long taskTimeout) void
setThreadPoolName
(String threadPoolName) Methods inherited from class org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
cancelRemainingTask, createExecutor, execute, execute, getActiveCount, getClock, getPoolSize, getScheduledExecutor, getScheduledThreadPoolExecutor, 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, setBeanName, 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.core.task.AsyncTaskExecutor
submitCompletable, submitCompletable
Methods inherited from interface org.springframework.scheduling.SchedulingTaskExecutor
prefersShortLivedTasks
Methods inherited from interface org.springframework.scheduling.TaskScheduler
schedule, scheduleAtFixedRate, scheduleAtFixedRate, scheduleWithFixedDelay, scheduleWithFixedDelay
-
Field Details
-
SIMPLE_CLASS_NAME
-
sofaScheduledThreadPoolExecutor
-
threadPoolName
-
spaceName
-
taskTimeout
protected long taskTimeout -
period
protected long period
-
-
Constructor Details
-
SofaThreadPoolTaskScheduler
public SofaThreadPoolTaskScheduler()
-
-
Method Details
-
initializeExecutor
protected ExecutorService initializeExecutor(ThreadFactory threadFactory, RejectedExecutionHandler rejectedExecutionHandler) - Overrides:
initializeExecutor
in classorg.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
-
createName
-
getThreadPoolName
-
setThreadPoolName
-
getSpaceName
-
setSpaceName
-
getTaskTimeout
public long getTaskTimeout() -
setTaskTimeout
public void setTaskTimeout(long taskTimeout) -
getPeriod
public long getPeriod() -
setPeriod
public void setPeriod(long period) -
getTimeUnit
-