public class OSGiPluginRegistry extends Object implements PluginRegistry
Modifier and Type | Class and Description |
---|---|
protected static class |
OSGiPluginRegistry.ExtensionSorter
Sorter for extensions that puts DataNucleus extensions first, then any vendor extension.
|
Constructor and Description |
---|
OSGiPluginRegistry(ClassLoaderResolver clr)
Constructor
|
Modifier and Type | Method and Description |
---|---|
Object |
createExecutableExtension(ConfigurationElement confElm,
String name,
Class[] argsClass,
Object[] args)
Loads a class (do not initialize) from an attribute of
ConfigurationElement |
Bundle[] |
getBundles()
Accessor for all registered bundles.
|
ExtensionPoint |
getExtensionPoint(String id)
Accessor for the ExtensionPoint with the specified id.
|
ExtensionPoint[] |
getExtensionPoints()
Acessor for the currently registed ExtensionPoints
|
Class |
loadClass(String pluginId,
String className)
Loads a class (do not initialize)
|
void |
registerExtensionPoints()
Look for Bundles/Plugins and register them.
|
protected void |
registerExtensionPointsForPluginInternal(List extPoints,
boolean updateExtensionPointsArray)
Register extension-points for the specified plugin.
|
void |
registerExtensions()
Look for Bundles/Plugins and register them.
|
void |
resolveConstraints()
Resolve constraints declared in bundle manifest.mf files.
|
URL |
resolveURLAsFileURL(URL url)
Converts a URL that uses a user-defined protocol into a URL that uses the file protocol.
|
public OSGiPluginRegistry(ClassLoaderResolver clr)
clr
- the ClassLoaderResolverpublic ExtensionPoint getExtensionPoint(String id)
getExtensionPoint
in interface PluginRegistry
id
- the unique id of the extension pointpublic ExtensionPoint[] getExtensionPoints()
PluginRegistry
getExtensionPoints
in interface PluginRegistry
public void registerExtensionPoints()
registerExtensionPoints
in interface PluginRegistry
public void registerExtensions()
PluginRegistry
registerExtensions
in interface PluginRegistry
protected void registerExtensionPointsForPluginInternal(List extPoints, boolean updateExtensionPointsArray)
extPoints
- ExtensionPoints for this pluginupdateExtensionPointsArray
- Whether to update "extensionPoints" arraypublic Object createExecutableExtension(ConfigurationElement confElm, String name, Class[] argsClass, Object[] args) throws ClassNotFoundException, SecurityException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException
ConfigurationElement
createExecutableExtension
in interface PluginRegistry
confElm
- the configuration elementname
- the attribute nameargsClass
- Classes of the argsargs
- The argumentsNoSuchMethodException
- if an error occursSecurityException
- if an error occursInvocationTargetException
- if an error occursIllegalAccessException
- if an error occursInstantiationException
- if an error occursIllegalArgumentException
- if an error occursClassNotFoundException
- If an error occurspublic Class loadClass(String pluginId, String className) throws ClassNotFoundException
loadClass
in interface PluginRegistry
pluginId
- the plugin idclassName
- the class nameClassNotFoundException
- if there is a problem in loadingpublic URL resolveURLAsFileURL(URL url) throws IOException
PluginRegistry
resolveURLAsFileURL
in interface PluginRegistry
url
- the url to be convertedIOException
- if an error occurspublic void resolveConstraints()
resolveConstraints
in interface PluginRegistry
public Bundle[] getBundles()
getBundles
in interface PluginRegistry
UnsupportedOperationException
- if this operation is not supported by the implementationCopyright © 2019. All rights reserved.