public class PluginManager extends Object
| Constructor and Description |
|---|
PluginManager() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addFromProperties(File propsFile)
Add all key value pairs from the supplied property file
|
static void |
addFromProperties(InputStream propsStream)
Add all key value pairs from the supplied properties stream
|
static void |
addFromProperties(Properties props)
Add all key value pairs from the supplied properties object
|
static void |
addPlugin(String interfaceName,
String name,
String concreteType)
Add a plugin.
|
static void |
addToDisabledList(List<String> classnames)
Add the supplied list of fully qualified class names to the disabled list
|
static void |
addToDisabledList(String classname)
Add the supplied fully qualified class name to the list of disabled plugins
|
static Object |
getPluginInstance(String interfaceType,
String name)
Get an instance of a concrete implementation of a plugin type
|
static Set<String> |
getPluginNamesOfType(String interfaceName)
Get a set of names of plugins that implement the supplied interface.
|
static boolean |
isInDisabledList(String classname)
Returns true if the supplied fully qualified class name is in the disabled
list
|
static void |
removeFromDisabledList(List<String> classnames)
Remove the supplied list of fully qualified class names to the disabled
list
|
static void |
removeFromDisabledList(String classname)
Remove the supplied fully qualified class name from the list of disabled
plugins
|
static void |
removePlugin(String interfaceName,
String name)
Remove a plugin.
|
static void |
removePlugins(String interfaceName,
List<String> names)
Remove plugins of a specific type.
|
public static void addToDisabledList(List<String> classnames)
classnames - a list of class names to addpublic static void addToDisabledList(String classname)
classname - the fully qualified name of a class to addpublic static void removeFromDisabledList(List<String> classnames)
classnames - a list of class names to removepublic static void removeFromDisabledList(String classname)
classname - the fully qualified name of a class to removepublic static boolean isInDisabledList(String classname)
classname - the name of the class to checkpublic static void addFromProperties(File propsFile) throws Exception
propsFile - the properties file to addException - if a problem occurspublic static void addFromProperties(InputStream propsStream) throws Exception
propsStream - an input stream to a properties fileException - if a problem occurspublic static void addFromProperties(Properties props) throws Exception
props - a Properties objectException - if a problem occurspublic static Set<String> getPluginNamesOfType(String interfaceName)
interfaceName - the fully qualified name of the interface to list
plugins forpublic static void addPlugin(String interfaceName, String name, String concreteType)
interfaceName - the fully qualified interface name that the plugin
implementsname - the name/short description of the pluginconcreteType - the fully qualified class name of the actual concrete
implementationpublic static void removePlugins(String interfaceName, List<String> names)
interfaceName - the fully qualified interface name that the plugins to
be remove implementnames - a list of named plugins to removepublic static void removePlugin(String interfaceName, String name)
interfaceName - the fully qualified interface name that the plugin
implementsname - the name/short description of the pluginpublic static Object getPluginInstance(String interfaceType, String name) throws Exception
interfaceType - the fully qualified interface name of the plugin typename - the name/short description of the plugin to getException - if the plugin can't be found or instantiatedCopyright © 2014 University of Waikato, Hamilton, NZ. All Rights Reserved.