public class FolderScanPluginManager extends java.lang.Object implements PluginManager
PluginManager is responsible to load and manage plugins from the file system.
The Plugin Folder configuration is received from the ConfigManager and usually
defaults to {workpath}/plugins. The plugins uses Java's SPI and have to implement interfaces from
serving-api.
| Constructor and Description |
|---|
FolderScanPluginManager(ConfigManager configManager)
Constructs a
PluginManager instance. |
| Modifier and Type | Method and Description |
|---|---|
<T> java.util.Set<T> |
findImplementations(java.lang.Class<T> pluginInterface)
returns a set of plug-in components implementing the specific service interface.
|
void |
loadPlugins()
Loads all plugins from the plugin folder and register them.
|
public FolderScanPluginManager(ConfigManager configManager)
PluginManager instance.configManager - a instance of the configManager to lookup configuration like
plugin-folder.public void loadPlugins()
throws java.io.IOException
java.io.IOException - when error during IO operation occurs.public <T> java.util.Set<T> findImplementations(java.lang.Class<T> pluginInterface)
only active plug-ins are returned which are fully initialised at this point.
Set<RequestHandler>
allActiveRequestHandler=findImplementations(RequestHandler.class)
findImplementations in interface PluginManagerT - generic type of service interfacepluginInterface - the specific service interface