public interface ThreadPoolPluginManager
ThreadPoolPlugin.
Bind with the specified thread-pool instance to register and manage plugins.
when the thread pool is destroyed, please ensure that the manager will also be destroyed.| 限定符和类型 | 方法和说明 |
|---|---|
void |
clear()
Clear all.
|
static ThreadPoolPluginManager |
empty()
Get an empty manager.
|
default Collection<PluginRuntime> |
getAllPluginRuntimes()
Get
PluginRuntime of all registered plugins. |
Collection<ThreadPoolPlugin> |
getAllPlugins()
Get all registered plugins.
|
default <A extends ThreadPoolPlugin> |
getAllPluginsOfType(Class<A> pluginType)
Get all plugins of type.
|
Collection<ExecuteAwarePlugin> |
getExecuteAwarePluginList()
Get execute aware plugin list.
|
<A extends ThreadPoolPlugin> |
getPlugin(String pluginId)
Get
ThreadPoolPlugin. |
default <A extends ThreadPoolPlugin> |
getPluginOfType(String pluginId,
Class<A> pluginType)
Get plugin of type.
|
Collection<RejectedAwarePlugin> |
getRejectedAwarePluginList()
Get rejected aware plugin list.
|
default Optional<PluginRuntime> |
getRuntime(String pluginId)
Get
PluginRuntime of registered plugin. |
Collection<ShutdownAwarePlugin> |
getShutdownAwarePluginList()
Get shutdown aware plugin list.
|
Collection<TaskAwarePlugin> |
getTaskAwarePluginList()
Get shutdown aware plugin list.
|
boolean |
isRegistered(String pluginId)
Whether the
ThreadPoolPlugin has been registered. |
void |
register(ThreadPoolPlugin plugin)
Register a
ThreadPoolPlugin. |
boolean |
tryRegister(ThreadPoolPlugin plugin)
Register plugin if it's not registered.
|
void |
unregister(String pluginId)
Unregister
ThreadPoolPlugin. |
static ThreadPoolPluginManager empty()
void clear()
Collection<ThreadPoolPlugin> getAllPlugins()
void register(ThreadPoolPlugin plugin)
ThreadPoolPlugin.plugin - pluginIllegalArgumentException - thrown when a plugin with the same ThreadPoolPlugin.getId()
already exists in the registryThreadPoolPlugin.getId()boolean tryRegister(ThreadPoolPlugin plugin)
plugin - pluginboolean isRegistered(String pluginId)
ThreadPoolPlugin has been registered.pluginId - plugin idvoid unregister(String pluginId)
ThreadPoolPlugin.pluginId - plugin id<A extends ThreadPoolPlugin> Optional<A> getPlugin(String pluginId)
ThreadPoolPlugin.A - target aware typepluginId - plugin idThreadPoolPluginClassCastException - thrown when the object obtained by name cannot be converted to target typeCollection<ExecuteAwarePlugin> getExecuteAwarePluginList()
Collection<RejectedAwarePlugin> getRejectedAwarePluginList()
Collection<ShutdownAwarePlugin> getShutdownAwarePluginList()
Collection<TaskAwarePlugin> getTaskAwarePluginList()
default <A extends ThreadPoolPlugin> Optional<A> getPluginOfType(String pluginId, Class<A> pluginType)
pluginId - plugin idpluginType - plugin typedefault <A extends ThreadPoolPlugin> Collection<A> getAllPluginsOfType(Class<A> pluginType)
pluginType - plugin typedefault Collection<PluginRuntime> getAllPluginRuntimes()
PluginRuntime of all registered plugins.PluginRuntime of all registered pluginsdefault Optional<PluginRuntime> getRuntime(String pluginId)
PluginRuntime of registered plugin.PluginRuntime of registered pluginCopyright © 2022. All rights reserved.