public class PluginManager extends Object
| Constructor and Description |
|---|
PluginManager(String registryClassName,
ClassLoaderResolver clr,
Properties props)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
createExecutableExtension(String extensionPoint,
String[] discrimAttrName,
String[] discrimAttrValue,
String attributeName,
Class[] argsClass,
Object[] args)
Convenience accessor for getting the Class of an attribute for an extension (of an extension point).
|
Object |
createExecutableExtension(String extensionPoint,
String discrimAttrName,
String discrimAttrValue,
String attributeName,
Class[] argsClass,
Object[] args)
Convenience accessor for getting the Class of an attribute for an extension (of an extension point).
|
static PluginManager |
createPluginManager(Map props,
ClassLoader loader)
Convenience method that will create and return a PluginManager using any passed in properties.
|
String |
getAttributeValueForExtension(String extensionPoint,
String[] discrimAttrName,
String[] discrimAttrValue,
String attributeName)
Convenience accessor for getting the value of an attribute for an extension (of an extension point).
|
String |
getAttributeValueForExtension(String extensionPoint,
String discrimAttrName,
String discrimAttrValue,
String attributeName)
Convenience accessor for getting the value of an attribute for an extension (of an extension point).
|
String[] |
getAttributeValuesForExtension(String extensionPoint,
String discrimAttrName,
String discrimAttrValue,
String attributeName)
Convenience accessor for getting the value of an attribute for an extension (of an extension point).
|
ConfigurationElement |
getConfigurationElementForExtension(String extensionPointName,
String[] discrimAttrName,
String[] discrimAttrValue)
Convenience accessor for getting the ConfigurationElement for an extension (of an extension point).
|
ConfigurationElement |
getConfigurationElementForExtension(String extensionPointName,
String discrimAttrName,
String discrimAttrValue)
Convenience accessor for getting the (first) ConfigurationElement for an extension (of an extension point).
|
ConfigurationElement[] |
getConfigurationElementsForExtension(String extensionPointName,
String discrimAttrName,
String discrimAttrValue)
Convenience accessor for getting the ConfigurationElement(s) for an extension (of an extension point).
|
ExtensionPoint |
getExtensionPoint(String id)
Acessor for the ExtensionPoint
|
String |
getRegistryClassName()
Accessor for the PluginRegistry class name.
|
String |
getVersionForBundle(String bundleName)
Accessor for the version of a particular bundle (or null if not registered).
|
Class |
loadClass(String pluginId,
String className)
Loads a class (do not initialize)
|
URL |
resolveURLAsFileURL(URL url)
Converts a URL that uses a user-defined protocol into a URL that uses the file protocol.
|
public PluginManager(String registryClassName, ClassLoaderResolver clr, Properties props)
registryClassName - Name of the registryclr - the ClassLoaderResolverprops - Configuration properties for the plugin systempublic String getRegistryClassName()
public ExtensionPoint getExtensionPoint(String id)
id - the unique id of the extension pointpublic ConfigurationElement getConfigurationElementForExtension(String extensionPointName, String discrimAttrName, String discrimAttrValue)
extensionPointName - The extension pointdiscrimAttrName - Attribute on the extension to use as discriminatordiscrimAttrValue - Value for discriminator attributepublic ConfigurationElement[] getConfigurationElementsForExtension(String extensionPointName, String discrimAttrName, String discrimAttrValue)
extensionPointName - The extension pointdiscrimAttrName - Attribute on the extension to use as discriminatordiscrimAttrValue - Value for discriminator attributepublic ConfigurationElement getConfigurationElementForExtension(String extensionPointName, String[] discrimAttrName, String[] discrimAttrValue)
extensionPointName - The extension pointdiscrimAttrName - Attribute on the extension to use as discriminator1discrimAttrValue - Value for discriminator1 attributepublic String getAttributeValueForExtension(String extensionPoint, String discrimAttrName, String discrimAttrValue, String attributeName)
extensionPoint - The extension pointdiscrimAttrName - Attribute on the extension to use as discriminatordiscrimAttrValue - Value for discriminator attributeattributeName - Name of the attribute whose value we wantpublic String[] getAttributeValuesForExtension(String extensionPoint, String discrimAttrName, String discrimAttrValue, String attributeName)
extensionPoint - The extension pointdiscrimAttrName - Attribute on the extension to use as discriminatordiscrimAttrValue - Value for discriminator attributeattributeName - Name of the attribute whose value we wantpublic String getAttributeValueForExtension(String extensionPoint, String[] discrimAttrName, String[] discrimAttrValue, String attributeName)
extensionPoint - The extension pointdiscrimAttrName - Attribute on the extension to use as discriminator1discrimAttrValue - Value for discriminator1 attributeattributeName - Name of the attribute whose value we wantpublic Object createExecutableExtension(String extensionPoint, String discrimAttrName, String discrimAttrValue, String attributeName, Class[] argsClass, Object[] args) throws ClassNotFoundException, SecurityException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException
extensionPoint - The extension pointdiscrimAttrName - Attribute on the extension to use as discriminatordiscrimAttrValue - Value for discriminator attributeattributeName - Name of the attribute whose value we wantargsClass - Classes of the argumentsargs - The argumentsClassNotFoundException - if an error occursSecurityException - if an error occursNoSuchMethodException - if an error occursIllegalArgumentException - if an error occursInstantiationException - if an error occursIllegalAccessException - if an error occursInvocationTargetException - if an error occurspublic Object createExecutableExtension(String extensionPoint, String[] discrimAttrName, String[] discrimAttrValue, String attributeName, Class[] argsClass, Object[] args) throws ClassNotFoundException, SecurityException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException
extensionPoint - The extension pointdiscrimAttrName - First attribute on the extension to use as discriminatordiscrimAttrValue - Value for first discriminator attributeattributeName - Name of the attribute whose value we wantargsClass - Classes of the argumentsargs - The argumentsClassNotFoundException - if an error occursSecurityException - if an error occursNoSuchMethodException - if an error occursIllegalArgumentException - if an error occursInstantiationException - if an error occursIllegalAccessException - if an error occursInvocationTargetException - if an error occurspublic Class loadClass(String pluginId, String className) throws ClassNotResolvedException
pluginId - the plugin idclassName - the class nameClassNotResolvedException - if an error occurspublic URL resolveURLAsFileURL(URL url) throws IOException
url - the url to be convertedIOException - if an error occurspublic String getVersionForBundle(String bundleName)
bundleName - Name of the bundlepublic static PluginManager createPluginManager(Map props, ClassLoader loader)
props - Any properties defining the plugin manager capabilitiesloader - Any class loader to make use of when loadingCopyright © 2017. All rights reserved.