接口 ExecutorRepository
-
- 所有已知实现类:
DefaultExecutorRepository
@SPI("default") public interface ExecutorRepository
-
-
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 ExecutorServicecreateExecutorIfAbsent(URL url)Called by both Client and Server.voiddestroyAll()Destroy all executors that are not in shutdown stateExecutorServicegetExecutor(URL url)ScheduledExecutorServicegetServiceExporterExecutor()ExecutorServicegetSharedExecutor()Get the default shared threadpool.ScheduledExecutorServicenextScheduledExecutor()Returns a scheduler from the scheduler list, call this method whenever you need a scheduler for a cron job.voidupdateThreadpool(URL url, ExecutorService executor)Modify some of the threadpool's properties according to the url, for example, coreSize, maxSize, ...
-
-
-
方法详细资料
-
createExecutorIfAbsent
ExecutorService createExecutorIfAbsent(URL url)
Called by both Client and Server. TODO, consider separate these two parts. When the Client or Server starts for the first time, generate a new threadpool according to the parameters specified.- 参数:
url-- 返回:
-
getExecutor
ExecutorService getExecutor(URL url)
-
updateThreadpool
void updateThreadpool(URL url, ExecutorService executor)
Modify some of the threadpool's properties according to the url, for example, coreSize, maxSize, ...- 参数:
url-executor-
-
nextScheduledExecutor
ScheduledExecutorService nextScheduledExecutor()
Returns a scheduler from the scheduler list, call this method whenever you need a scheduler for a cron job. If your cron cannot burden the possible schedule delay caused by sharing the same scheduler, please consider define a dedicate one.- 返回:
-
getServiceExporterExecutor
ScheduledExecutorService getServiceExporterExecutor()
-
getSharedExecutor
ExecutorService getSharedExecutor()
Get the default shared threadpool.- 返回:
-
destroyAll
void destroyAll()
Destroy all executors that are not in shutdown state
-
-