Package is.galia.plugin


package is.galia.plugin

Contains classes related to local plugin management, as well as the main plugin interface, Plugin.

Interfaces

All plugins implement Plugin in addition to other interface(s) related to their function: VariantCache, Decoder, etc.

Plugin classes may reside in any package, but they should not share package names with other plugins or with the application itself.

Versioning

The core application has two distinct versions: an implementation version and a specification version. Plugins are independently versioned and may have any implementation version, but their specification version must be compatible with that of the application.

Packaging

Plugins are distributed as zip files with names in the following format:

plugin_name-major.minor.patch.zip

After extraction, a plugin has the following structure:

  • plugin_name-major.minor.patch
    • lib/
      • plugin_name-major.minor.patch.jar
      • (possibly other dependencies)
    • LICENSE.txt
    • README.md
    • (possibly others)

Plugins rely on the JDK's ServiceLoader mechanism. In order to make that work, the plugin JAR file contains a META-INF/services/[plugin interface] file containing the fully qualified class names of all plugin classes in the JAR.

It also contains a META-INF/MANIFEST.MF file which contains a Specification-Version line referring to the version of the application API contract. A plugin implementation is considered to be compatible with that version and all later minor versions within the same major version, but not with any later major versions.

Installation

Plugin folders physically reside in the plugins directory. A plugin's JAR file is all that is needed for it to function, but its containing directory is what the plugin management tools consider to be "the plugin"—so, when a plugin is installed, its containing folder is what is added to the plugins directory; when it is removed, its containing folder is what is removed; etc. PluginManager is the main plugin management tool.

Updating

The update process is similar to the installation process. After state has been validated and a newer compatible plugin has been confirmed to exist, the current plugin is backed up (by adding a backup suffix to its folder name) and the new version is extracted in its place. See PluginUpdater.

Removal

Removal is a simple matter of either deleting the plugin JAR, or appending a backup suffix to its name. See PluginRemover.