Extension bundles describe a collection of
Extension Descriptors.
A bundle may come from one of two places, either the Adito Application Store or from an installed extension bundle retrieved via the Repository.
If from the Adito Application Store, the descriptor will not contain all details, only enough to determine the name, description, versions, dependencies and a few others pieces of information. Such bundles do not have a life cycle in the way local extension bundles do (i.e. be Started, Stopped or Activated).
Local extension bundles must go through 3 or 4 phases.
- Phase 1. Loading. The XML extension descriptors are loaded and parsed. No change the state of Adito is made at this stage. Once this is complete we know the order the extensions should be started
- Phase 2. Starting. All extensions now have their {@link ExtensionDescriptor#start()} method called. This in turn delegates thestart to the Extension Type implementation in use. For example, the {@link PluginType} would create the plug-in instance and invoke the{@link Plugin#startPlugin(com.adito.extensions.types.PluginDefinition,ExtensionDescriptor,Element)}. If starting fails, an exception is thrown and the extension will be Stopped. method on it.
- Phase 3. Activation. Only the Plug-ins really use this as they require two phases of initialisation. If activate fails, an exception is thrown and the extension will be Stopped.
- Phase 4. Stopping. May occur either after Starting or Activation. During this phase the extension should clean up as much as possible (deregister property definitions, user databases or any other extension point).