public class PluginLoader extends Object
Constructor and Description |
---|
PluginLoader()
create instance with the default configuration file
|
PluginLoader(String pluginsConfigFile)
create instance with a custom configuration file
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(String pluginId)
test if a plugin is present
|
Map<String,ActionHandler> |
loadAllPlugins()
load All the plugins, and return a Map an instance of each plugin
WARNING : plugins are not thread safe
|
void |
loadConfiguration()
load the configuration file containing the list of plugins.
|
ActionHandler |
newInstance(String pluginId) |
public PluginLoader()
public PluginLoader(String pluginsConfigFile)
pluginsConfigFile
- path of the custom configuration file.public void loadConfiguration() throws FileNotFoundException, InvalidParseOperationException, PluginNotFoundException
{
"CHECK_DIGEST": {
"className": "fr.gouv.vitam.worker.core.plugin.CheckConformityActionPlugin",
"propertiesFile": "check_conformity_plugin.properties"
}
}
FileNotFoundException
- if file is not foundInvalidParseOperationException
- if file cannot be parsedPluginNotFoundException
- if the plugin is not found in the classpathpublic boolean contains(String pluginId)
pluginId
- id pluginpublic ActionHandler newInstance(String pluginId) throws InvocationPluginException, PluginNotFoundException
pluginId
- id of a pluginInvocationPluginException
- the plugin cannot be instanciate.PluginNotFoundException
- the plugin is not presentpublic Map<String,ActionHandler> loadAllPlugins() throws InvocationPluginException
InvocationPluginException
- if a plugin cannot be instanceCopyright © 2018 Vitam. All rights reserved.