Home
Categories
Dictionary
Download
Project Details
Changes Log
Tutorials
FAQ
License

Plugin factory



By default the activation process for each Plugin involves: An alternate way to instanciate a Plugin allows to instanciate Plugins which use complex frameworks such as Spring. This instanciation can come through a PluginFactory.

Regular activation process

Main Article: Plugins activation

The regular activation for one Plugin (here for for non UI applications) is:
  1. Instanciation of the Plugin
  2. Getting the plugins dependencies, allowing to get the dependencies between Plugins. After this step, Plugins which have declared dependencies on other Plugins but for which some of the Plugins on which they depend are not present will be discarded
  3. Register the Plugin, allowing to declare the Plugin in the framework
  4. If a Configuration manager exists for the application, deserialize the Plugin configuration
  5. Initialize the Plugin
  6. Reset the Plugin settings

Activation process with a factory

The activation process with a PluginFactory will use a different process:
  1. Instanciation of the PluginFactory, using the MDIPluginFactory property in the manifest to get the Classpath of the factory
  2. If a Configuration manager exists for the application, and the PluginFactory.getConfiguration() method does not return null, Deserialize the Plugin configuration with this configuration
  3. Call the PluginFactory.createPlugin(ClassLoader loader, MDIApplication appli, String pluginClass) method to create the Plugin using the MDIPluginClass property in the Plugin Manifest
  4. Getting the plugins dependencies, allowing to get the dependencies between Plugins. After this step, Plugins which have declared dependencies on other Plugins but for which some of the Plugins on which they depend are not present will be discarded
  5. Register the Plugin, allowing to declare the Plugin in the framework
  6. If a Configuration manager exists for the application, and the Configuration for the Plugin has not already been deserialized, deserialize the Plugin configuration
  7. Initialize the Plugin
  8. Reset the Plugin settings

Relationship between the Configuration and the Plugin

If the PluginFactory.getConfiguration() method of the PluginFactory does not return null, the configuration returned by this method will be used to Deserialize the Plugin configuration.

In that case, it will be of the responsability of the PluginFactory to pass the appropriate configuration to the Plugin it creates.

See also


Categories: Plugins

Copyright 2006-2023 Herve Girod. All Rights Reserved. Documentation and source under the LGPL v2 and Apache 2.0 licences