public class DefaultAppPluginRegistry<T extends AppPlugin> extends Object implements AppPluginRegistry<T>
AppPluginRegistry
that loads Plugins
via the ServiceLoader
facilities provided by the Java SE platform.Modifier and Type | Field and Description |
---|---|
protected Map<String,T> |
pluginsMap |
protected Class<T> |
pluginType
the interface type of plugins managed by this registry
|
Constructor and Description |
---|
DefaultAppPluginRegistry(Class<T> pluginType) |
Modifier and Type | Method and Description |
---|---|
T |
getPlugin(String id)
Returns the registered plugin with the given name or
null if the plugin does not exist. |
List<T> |
getPlugins()
Returns all registered plugins
|
protected void |
loadPlugins() |
protected final Class<T extends AppPlugin> pluginType
protected void loadPlugins()
public List<T> getPlugins()
AppPluginRegistry
getPlugins
in interface AppPluginRegistry<T extends AppPlugin>
public T getPlugin(String id)
AppPluginRegistry
null
if the plugin does not exist.getPlugin
in interface AppPluginRegistry<T extends AppPlugin>
Copyright © 2022. All rights reserved.