Differences
This shows you the differences between two versions of the page.
|
projects:sdf_irc:help:how_plug-ins_are_loaded [2009/11/19 11:28] StevenSDF Added a more robust way of managing plug-ins |
projects:sdf_irc:help:how_plug-ins_are_loaded [2009/11/19 16:46] (current) StevenSDF Made a few changes from what was planned to how it is actually working. |
||
|---|---|---|---|
| Line 16: | Line 16: | ||
| - The program starts | - The program starts | ||
| - Plug-in Provider Service gets started | - Plug-in Provider Service gets started | ||
| - | - The service searches the plug-in directory, finding each file and reading its manifest (this is to build up a "map" of what is where.) | + | - The service searches the plug-in directory, finding each file loading the class defined within the manifest. |
| - | * An alternative could be that the "map" is stored and then modified when plug-ins are added and removed. | + | - It reads the details from the class annotations getting the supported API version. |
| + | - If the API version is not supported an exception is thrown and the plug-in is disabled. | ||
| - The program asks for plug-ins that should be started by default. | - The program asks for plug-ins that should be started by default. | ||
| - The plug-in service gets the list from settings. | - The plug-in service gets the list from settings. | ||
| Line 24: | Line 25: | ||
| ==== Loading and Starting Plug-ins ==== | ==== Loading and Starting Plug-ins ==== | ||
| - A request is put to the Plug-in Provider Service | - A request is put to the Plug-in Provider Service | ||
| - | - Provider uses the "map" to open the correct file and load the plug-in class. | ||
| - | - It reads the details from the class annotations getting the supported API version. | ||
| - | - If the API version is not supported an exception is thrown and the plug-in class is released to be garbage collected. | ||
| - | - Else the class is instantiated. | ||
| - Once the class is instantiated the settings and descriptor for the class is loaded, from settings or from scratch. | - Once the class is instantiated the settings and descriptor for the class is loaded, from settings or from scratch. | ||
| - If it is to be created from scratch then plug-in's ''initSettings()'' method will be called. | - If it is to be created from scratch then plug-in's ''initSettings()'' method will be called. | ||