GitHub user chamilad opened a pull request: https://github.com/apache/stratos/pull/234
[STRATOS-1180] - Yapsy based plugin architecture for PCA A basic plugin system where <PCA_HOME>/plugins folder can be used to drop plugins to be picked up by the PCA. For this I've used Yapsy[1] plugin framework.Yapsy is both simple and effective in enabling a plugin structure in Python. It is BSD licensed so there is no conflict in licensing for incorporating it, if the need arises. Implementing a plugin for the PCA is simple. The plugin contract is defined in <PCA_HOME>/plugins/contracts.py module. To write a plugin contracts.ICartridgeAgentPlugin has to be extended. Additionally a plugin descriptor (with yapsy-plugin extension) has to be included which will describe and point to the plugin module file, when queried by the Yapsy framework. To map a plugin for a certain event, the event name has to be specified in the Description field. By this approach, it is possible to map more than one plugin to a single event and one plugin to several events. Each plugin is run in a separate thread, therefore, it will not be blocking the main execution. A plugin gets a dictionary with the payload parameters and any additional values included for specific events. This is more effective than the environment variables approach we had for bash scripts. A test plugin can be found in the <PCA_HOME>/plugins which demonstrates the plugin architecture. This plugin is mapped to the MemberInitializedEvent and the ArtifactUpdatedEvent. PCA was tested in an OpenStack deployment for regression and functionality. [1] - http://yapsy.sourceforge.net/ You can merge this pull request into a Git repository by running: $ git pull https://github.com/chamilad/stratos stratos-1180-01 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/stratos/pull/234.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #234 ---- commit f4be9ce8b37f4121b461d55fd9aa0b3daf773516 Author: Chamila de Alwis <chami...@wso2.com> Date: 2015-02-14T11:21:03Z PCA plugin architecture with Yapsy Dockerfile updated to install Yapsy Refactored Exceptions Refactored event handling PEP style related changes commit 6b938f65a09c082dd6ba95830e120a2832fdc020 Author: Chamila de Alwis <chami...@wso2.com> Date: 2015-02-14T15:19:36Z PCA - Fixed issues in plugin execution Added test plugin PEP style related changes Fixed import errors commit 4c253ea2251d012f04e49e870087d08c17fe1803 Author: Chamila de Alwis <chami...@wso2.com> Date: 2015-02-14T15:21:39Z PCA - fixed PEP style hints in constants module commit 2cb93ca72e1606859fadb40d7daa968a1afeed35 Author: Chamila de Alwis <chami...@wso2.com> Date: 2015-02-14T19:08:20Z PCA - A single plugin can be mapped to multiple events commit 3528415ebc118b777837ee03e7e13647f869dd05 Author: Chamila de Alwis <chami...@wso2.com> Date: 2015-02-19T04:58:44Z PCA - Yapsy based plugins - Added yapsy pip install to PCA puppet module ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---