org.datanucleus.plugin
Interface PluginRegistry

All Known Implementing Classes:
EclipsePluginRegistry, NonManagedPluginRegistry

public interface PluginRegistry

Loader and registry of Extensions and Extension Points. The implementation of this interface must have a public constructor taking the ClassLoaderResolver interface as argument. The plugin registry metadata/bundle resolution is ruled by OSGi specification. The following sections of the OSGi 3.0 specification must be fully supported: 3.5.2, 3.5.3, 3.2.4, 3.2.5. The section 3.6.3 is optional. All other OSGi parts not mentioned above are not likely to be supported.


Method Summary
 java.lang.Object createExecutableExtension(ConfigurationElement confElm, java.lang.String name, java.lang.Class[] argsClass, java.lang.Object[] args)
          Loads a class (do not initialize) from an attribute of ConfigurationElement
 Bundle[] getBundles()
          Accessor for all registered bundles
 ExtensionPoint getExtensionPoint(java.lang.String id)
          Acessor for the ExtensionPoint
 ExtensionPoint[] getExtensionPoints()
          Acessor for the currently registed ExtensionPoints
 java.lang.Class loadClass(java.lang.String pluginId, java.lang.String className)
          Loads a class (do not initialize)
 void registerExtensionPoints()
          Look for Bundles/Plugins and register them.
 void registerExtensions()
          Look for Bundles/Plugins and register them.
 void resolveConstraints()
          Resolve constraints declared in bundle manifest.mf files.
 java.net.URL resolveURLAsFileURL(java.net.URL url)
          Converts a URL that uses a user-defined protocol into a URL that uses the file protocol.
 

Method Detail

getExtensionPoint

ExtensionPoint getExtensionPoint(java.lang.String id)
Acessor for the ExtensionPoint

Parameters:
id - the unique id of the extension point
Returns:
null if the ExtensionPoint is not registered

getExtensionPoints

ExtensionPoint[] getExtensionPoints()
Acessor for the currently registed ExtensionPoints

Returns:
array of ExtensionPoints

registerExtensionPoints

void registerExtensionPoints()
Look for Bundles/Plugins and register them. Register also ExtensionPoints and Extensions declared in /plugin.xml files


registerExtensions

void registerExtensions()
Look for Bundles/Plugins and register them. Register also ExtensionPoints and Extensions declared in /plugin.xml files


createExecutableExtension

java.lang.Object createExecutableExtension(ConfigurationElement confElm,
                                           java.lang.String name,
                                           java.lang.Class[] argsClass,
                                           java.lang.Object[] args)
                                           throws java.lang.ClassNotFoundException,
                                                  java.lang.SecurityException,
                                                  java.lang.NoSuchMethodException,
                                                  java.lang.IllegalArgumentException,
                                                  java.lang.InstantiationException,
                                                  java.lang.IllegalAccessException,
                                                  java.lang.reflect.InvocationTargetException
Loads a class (do not initialize) from an attribute of ConfigurationElement

Parameters:
confElm - the configuration element
name - the attribute name
Returns:
the Class
Throws:
java.lang.ClassNotFoundException
java.lang.SecurityException
java.lang.NoSuchMethodException
java.lang.IllegalArgumentException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException

loadClass

java.lang.Class loadClass(java.lang.String pluginId,
                          java.lang.String className)
                          throws java.lang.ClassNotFoundException
Loads a class (do not initialize)

Parameters:
pluginId - the plugin id
className - the class name
Returns:
the Class
Throws:
java.lang.ClassNotFoundException

resolveURLAsFileURL

java.net.URL resolveURLAsFileURL(java.net.URL url)
                                 throws java.io.IOException
Converts a URL that uses a user-defined protocol into a URL that uses the file protocol.

Parameters:
url - the url to be converted
Returns:
the converted URL
Throws:
java.io.IOException

resolveConstraints

void resolveConstraints()
Resolve constraints declared in bundle manifest.mf files. This must be invoked after registering all bundles. Should log errors if bundles are not resolvable, or raise runtime exceptions.


getBundles

Bundle[] getBundles()
Accessor for all registered bundles

Returns:
the bundles
Throws:
java.lang.UnsupportedOperationException - if this operation is not supported by the implementation


Copyright © 2011. All Rights Reserved.