public class DefaultExecutorRepository extends Object implements ExecutorRepository
Licycle to enable executors shutdown when the process stops.| Constructor and Description |
|---|
DefaultExecutorRepository() |
| Modifier and Type | Method and Description |
|---|---|
ExecutorService |
createExecutorIfAbsent(URL url)
Get called when the server or client instance initiating.
|
void |
destroyAll()
Destroy all executors that are not in shutdown state
|
ExecutorService |
getExecutor(URL url) |
ScheduledExecutorService |
getServiceExporterExecutor() |
ExecutorService |
getSharedExecutor()
Get the default shared threadpool.
|
ScheduledExecutorService |
nextScheduledExecutor()
Returns a scheduler from the scheduler list, call this method whenever you need a scheduler for a cron job.
|
void |
updateThreadpool(URL url,
ExecutorService executor)
Modify some of the threadpool's properties according to the url, for example, coreSize, maxSize, ...
|
public ExecutorService createExecutorIfAbsent(URL url)
createExecutorIfAbsent in interface ExecutorRepositoryurl - public ExecutorService getExecutor(URL url)
getExecutor in interface ExecutorRepositorypublic void updateThreadpool(URL url, ExecutorService executor)
ExecutorRepositoryupdateThreadpool in interface ExecutorRepositorypublic ScheduledExecutorService nextScheduledExecutor()
ExecutorRepositorynextScheduledExecutor in interface ExecutorRepositorypublic ScheduledExecutorService getServiceExporterExecutor()
getServiceExporterExecutor in interface ExecutorRepositorypublic ExecutorService getSharedExecutor()
ExecutorRepositorygetSharedExecutor in interface ExecutorRepositorypublic void destroyAll()
ExecutorRepositorydestroyAll in interface ExecutorRepositoryCopyright © 2011–2022 The Apache Software Foundation. All rights reserved.