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(File propsFile,
boolean maintainInsertionOrder)
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(InputStream propsStream,
boolean maintainInsertionOrder)
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 |
addFromProperties(Properties props,
boolean maintainInsertionOrder)
Add all key value pairs from the supplied properties object
|
static void |
addPlugin(String interfaceName,
String name,
String concreteType)
Add a plugin.
|
static void |
addPlugin(String interfaceName,
String name,
String concreteType,
boolean maintainInsertionOrder)
Add a plugin.
|
static void |
addPluginResource(String resourceGroupID,
String resourceDescription,
String resourcePath)
Add a resource.
|
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 InputStream |
getPluginResourceAsStream(String resourceGroupID,
String resourceDescription)
Get an input stream for a named resource under a given resource group ID.
|
static Map<String,String> |
getResourcesWithGroupID(String resourceGroupID)
Get a map of resources (description,path) registered under a given resource
group ID.
|
static boolean |
isInDisabledList(String classname)
Returns true if the supplied fully qualified class name is in the disabled
list
|
static int |
numResourcesForWithGroupID(String resourceGroupID)
Get the number of resources available under a given resource group ID.
|
static boolean |
pluginRegistered(String interfaceType,
String name)
Checks if a named plugin exists in the map of registered plugins
|
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(File propsFile, boolean maintainInsertionOrder) throws Exception
propsFile - the properties file to addmaintainInsertionOrder - true if the order of insertion of
implementations is to be preserved (rather than sorted order)Exception - 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(InputStream propsStream, boolean maintainInsertionOrder) throws Exception
propsStream - an input stream to a properties filemaintainInsertionOrder - true if the order of insertion of
implementations is to be preserved (rather than sorted order)Exception - if a problem occurspublic static void addFromProperties(Properties props) throws Exception
props - a Properties objectException - if a problem occurspublic static void addFromProperties(Properties props, boolean maintainInsertionOrder) throws Exception
props - a Properties objectmaintainInsertionOrder - true if the order of insertion of
implementations is to be preserved (rather than sorted order)Exception - if a problem occurspublic static void addPluginResource(String resourceGroupID, String resourceDescription, String resourcePath)
resourceGroupID - the ID of the group under which the resource should
be storedresourceDescription - the description/ID of the resourceresourcePath - the path to the resourcepublic static InputStream getPluginResourceAsStream(String resourceGroupID, String resourceDescription) throws IOException
resourceGroupID - the group ID that the resource falls underresourceDescription - the description/ID of the resourceIOException - if the group ID or resource description/ID are not
known to the PluginManager, or a problem occurs while trying to
open an input streampublic static int numResourcesForWithGroupID(String resourceGroupID)
resourceGroupID - the group ID of the resourcespublic static Map<String,String> getResourcesWithGroupID(String resourceGroupID)
resourceGroupID - the group ID of the resources to getpublic 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 addPlugin(String interfaceName, String name, String concreteType, boolean maintainInsertionOrder)
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
implementationmaintainInsertionOrder - true if the order of insertion of
implementations is to be preserved (rather than sorted order)public 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 boolean pluginRegistered(String interfaceType, String name)
interfaceType - the fully qualified interface name of the plugin typename - the name/short description of the plugin to getpublic 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 © 2016 University of Waikato, Hamilton, NZ. All Rights Reserved.