Skip to content

The Plugin Concept

iks github user edited this page Jul 17, 2014 · 23 revisions

[Back to the overview of Concepts] (https://github.com/iks-github/MOGLiCodeCreator/wiki/Concepts)


The basic plugin idea is described in chapter [Solution, Ideas and Strategy] (https://github.com/iks-github/MOGLiCodeCreator/wiki/Solution%2C-Ideas-and-Strategy). Some further insight is provided in the [Building Block View] (https://github.com/iks-github/MOGLiCodeCreator/wiki/Building-Block-View) and the [Runtime View] (https://github.com/iks-github/MOGLiCodeCreator/wiki/Runtime-View).

Structure of a MOGLiCC plugin

When the MOGLiCC start script is started, the subdirectory "lib/plugins" in the application root dir (where the start script is located) is scanned for MOGLiCC plugins.

A MOGLiCC plugin is a jar-file with following attributes:

Plugin Hierarchy

The methods of the three most important plugin types are as follows:

The [MOGLiPlugin] (https://github.com/iks-github/MOGLiCodeCreator/blob/master/interfaces/src/main/java/com/iksgmbh/moglicc/plugin/MOGLiPlugin.java) is the most basic plugin type. The getID() method returns the name of the plugin which must unique in the plugin container.

Instantiation of a MOGLiCC plugin

The plugin container handles all plugins the following way:

  • when found, a PluginMetaData object (containing e.g. the name of the starter class) is created for the plugin
  • the plugin is loaded by instantiating the starter class via reflection and casting it on the type MOGLiPlugin
  • it is checked whether all dependencies returned by the getDependencies() method are resolved and an execution order is calculated
  • if necessary, help files are read from the plugin's jar file and written into the help subdirectory by calling the unpackPluginHelpFiles() method
  • if necessary, default input files are read from the plugin's jar file and written into the input subdirectory by calling the unpackDefaultInputData() method
  • a MOGLiCC infrastructure object is created and set to the plugin. This object is needed for execution (e.g. to get an instance from another plugin on which the executed plugin depends)
  • the plugin is executed by calling its doYourJob() method

[Back to the overview of Concepts] (https://github.com/iks-github/MOGLiCodeCreator/wiki/Concepts)

Clone this wiki locally