public final class ThreadPoolManager extends Object
For unified management of thread pool resources, the consumer can simply call the register method to register(String, String, ExecutorService) the thread pool that needs to be included in the life
cycle management of the resource
| 限定符和类型 | 方法和说明 |
|---|---|
void |
deregister(String namespace,
String group)
Cancel the uniform lifecycle management for all threads under this resource.
|
void |
deregister(String namespace,
String group,
ExecutorService executor)
Undoing the uniform lifecycle management of
ExecutorService under this resource. |
void |
destroy(String namespace)
Destroys all thread pool resources under this namespace.
|
void |
destroy(String namespace,
String group)
This namespace destroys all thread pool resources under the grouping.
|
static ThreadPoolManager |
getInstance() |
Map<String,Map<String,Set<ExecutorService>>> |
getResourcesManager() |
void |
register(String namespace,
String group,
ExecutorService executor)
Register the thread pool resources with the resource manager.
|
static void |
shutdown()
Shutdown thread pool manager.
|
public static ThreadPoolManager getInstance()
public void register(String namespace, String group, ExecutorService executor)
namespace - namespace namegroup - group nameexecutor - ExecutorServicepublic void deregister(String namespace, String group)
namespace - namespace namegroup - group namepublic void deregister(String namespace, String group, ExecutorService executor)
ExecutorService under this resource.namespace - namespace namegroup - group nameexecutor - ExecutorServicepublic void destroy(String namespace)
namespace - namespacepublic void destroy(String namespace, String group)
namespace - namespacegroup - grouppublic static void shutdown()
Copyright © 2018–2024 Alibaba Group. All rights reserved.