Package fr.gouv.vitam.worker.core.plugin
Class PluginLoader
java.lang.Object
fr.gouv.vitam.worker.core.plugin.PluginLoader
load all the plugins according to plugins.json file.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
test if a plugin is presentload All the plugins, and return a Map an instance of each plugin WARNING : plugins are not thread safevoid
load the configuration file containing the list of plugins.newInstance
(String pluginId)
-
Constructor Details
-
PluginLoader
create instance with the default configuration file- Throws:
IllegalPathException
-
-
Method Details
-
loadConfiguration
public void loadConfiguration() throws FileNotFoundException, InvalidParseOperationException, PluginNotFoundExceptionload the configuration file containing the list of plugins. file is a json format.Example :
{ "CHECK_DIGEST": { "className": "fr.gouv.vitam.worker.core.plugin.CheckConformityActionPlugin", "propertiesFile": "check_conformity_plugin.properties" } }
- Throws:
FileNotFoundException
- if file is not foundInvalidParseOperationException
- if file cannot be parsedPluginNotFoundException
- if the plugin is not found in the classpath
-
contains
test if a plugin is present- Parameters:
pluginId
- id plugin- Returns:
- true if present, false otherwise
-
newInstance
public ActionHandler newInstance(String pluginId) throws InvocationPluginException, PluginNotFoundException - Parameters:
pluginId
- id of a plugin- Returns:
- an new instance of a plugin
- Throws:
InvocationPluginException
- the plugin cannot be instanciate.PluginNotFoundException
- the plugin is not present
-
loadAllPlugins
load All the plugins, and return a Map an instance of each plugin WARNING : plugins are not thread safe- Returns:
- list of all plugins
- Throws:
InvocationPluginException
- if a plugin cannot be instance
-