public class PluginRegistry extends Object implements IPluginRegistry
PluginRegistry maintains a
static HashMap<String, IPlugin>, where all operators are
put when IPlugin.init() is called.
The PluginRegistry can be queried for all currently loaded
plugins and contains the unique names of the associated IOperator.
The PluginRegistry is designed as singleton.
| Modifier and Type | Field and Description |
|---|---|
private static HashMap<String,String> |
associatedOperators
A
HashMap containing the containing operator name in the plugin. |
private static org.apache.log4j.Logger |
logger
Class specific logger.
|
private static HashMap<String,IPlugin> |
pluginRegistry
|
| Modifier | Constructor and Description |
|---|---|
private |
PluginRegistry()
Private constructor, since
PluginRegistry is a singleton. |
| Modifier and Type | Method and Description |
|---|---|
String |
findOperatorName(String pluginName)
Gets the name of the operator associated with the plugin.
|
static IPluginRegistry |
getInstance()
Returns a reference to the singleton.
|
IPlugin |
getPlugin(String pluginName)
Gets the
IPlugin instance from the registry. |
HashMap<String,IPlugin> |
getPlugins()
Returns all registered plugins.
|
void |
printAllRegisteredPlugins() |
void |
register(IPlugin plugin,
String opName)
Registers an
IPlugin in the IQM registry with its name (String). |
void |
unregister(IPlugin plugin)
Removes an
IPlugin from the IQM registry. |
private PluginRegistry()
PluginRegistry is a singleton.public static IPluginRegistry getInstance()
PluginRegistrypublic void register(IPlugin plugin, String opName)
IPluginRegistryIPlugin in the IQM registry with its name (String).register in interface IPluginRegistrypublic void unregister(IPlugin plugin)
IPluginRegistryIPlugin from the IQM registry.unregister in interface IPluginRegistrypublic IPlugin getPlugin(String pluginName) throws NoSuchElementException
IPluginRegistryIPlugin instance from the registry.getPlugin in interface IPluginRegistrypluginName - the unique name of a pluginIPluginNoSuchElementException - if the name is not registeredpublic HashMap<String,IPlugin> getPlugins()
IPluginRegistrygetPlugins in interface IPluginRegistryHashMap containing all pluginspublic String findOperatorName(String pluginName) throws NoSuchElementException
IPluginRegistryfindOperatorName in interface IPluginRegistrypluginName - the uid of a pluginNoSuchElementException - if the plugin is not registeredpublic void printAllRegisteredPlugins()
Copyright © 2009–2017 Helmut Ahammer, Philipp Kainz. All rights reserved.