org.datanucleus.plugin
Class EclipsePluginRegistry

java.lang.Object
  extended by org.datanucleus.plugin.EclipsePluginRegistry
All Implemented Interfaces:
PluginRegistry

public class EclipsePluginRegistry
extends java.lang.Object
implements PluginRegistry

Manages the registry of Extensions and Extension Points.


Constructor Summary
EclipsePluginRegistry(ClassLoaderResolver clr)
          Constructor
 
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()
          Register Extension Points
 void registerExtensions()
          Register ExtensionPoints and Extensions declared in plugin files
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EclipsePluginRegistry

public EclipsePluginRegistry(ClassLoaderResolver clr)
Constructor

Parameters:
clr - the ClassLoaderResolver
Method Detail

getExtensionPoint

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

Specified by:
getExtensionPoint in interface PluginRegistry
Parameters:
id - the unique id of the extension point
Returns:
null if the ExtensionPoint is not registered

getExtensionPoints

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

Specified by:
getExtensionPoints in interface PluginRegistry
Returns:
array of ExtensionPoints

registerExtensionPoints

public void registerExtensionPoints()
Register Extension Points

Specified by:
registerExtensionPoints in interface PluginRegistry

registerExtensions

public void registerExtensions()
Register ExtensionPoints and Extensions declared in plugin files

Specified by:
registerExtensions in interface PluginRegistry

resolveURLAsFileURL

public 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.

Specified by:
resolveURLAsFileURL in interface PluginRegistry
Parameters:
url - the url to be converted
Returns:
the converted URL
Throws:
java.io.IOException

createExecutableExtension

public 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

Specified by:
createExecutableExtension in interface PluginRegistry
Parameters:
confElm - the configuration element
name - the attribute name
Returns:
the Class
Throws:
java.lang.NoSuchMethodException
java.lang.SecurityException
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.IllegalArgumentException
java.lang.ClassNotFoundException

loadClass

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

Specified by:
loadClass in interface PluginRegistry
Parameters:
pluginId - the plugin id
className - the class name
Returns:
the Class
Throws:
java.lang.ClassNotFoundException

resolveConstraints

public 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.

Specified by:
resolveConstraints in interface PluginRegistry

getBundles

public Bundle[] getBundles()
Accessor for all registered bundles

Specified by:
getBundles in interface PluginRegistry
Returns:
the bundles
Throws:
java.lang.UnsupportedOperationException - if this operation is not supported by the implementation


Copyright © 2010. All Rights Reserved.