Plugin Framework
The extensibility system provides a framework for both, providing extensibility hooks,
and for extending the functionality of Columba.
A plugin is a bundle of extensions. An extension provides an implementation of a
specific functionality.
The {@link IPluginManager} manages all plugins as a singleton registry. Additionally, it
is also a registry for all available extension handlers. {@link IExtensionHandler} is a
registry for extensions. It resembles an extension point or hook to extend Columba's
functionality. {@IExtension} provides the metadata, describing an extensions.
Additionally, it is responsible for instanciating an extension. Every extension must
implement the interface {@link IExtensionInterface}.
When looking at {@link IExtensionHandler}, its obvious that it simply resembles a
registry for classes. All extensions have a unique id and the classname. The
extension handler keeps a hashtable of all extensions and uses a custom classloader
to instanciate extensions.
All extension handlers use xml files which can be found in /res directory.
This is merely an easy way to specify extensions easily, without hardcoding them in
Java. A list of all extension points for the core package can be found in:
org.columba.core.plugin.pluginhandler.xml . All core extension handler
files can be found in org.columba.core.plugin .
This is an example extension handler file:
Usually, when making use of extensions in Columba, you first get an instance of the
plugin manager using PluginManager.getInstance() . Then you have to
retrieve an appropriate extension handler getHandler(id) . Using this
handler, you get the extension using IExtensionHandler.getExtension(id) .
Now, you instanciate the plugin using IExtension.instanciate() .
|