From 389 Directory Server
| Revision as of 19:41, 2 November 2009 Nkinder (Talk | contribs) (→Design) ← Previous diff |
Revision as of 19:47, 2 November 2009 Nkinder (Talk | contribs) (→Design) Next diff → |
||
| Line 25: | Line 25: | ||
| The precedence of a plug-in will only order plug-ins within the same plug-in type. The available plug-in types are: | The precedence of a plug-in will only order plug-ins within the same plug-in type. The available plug-in types are: | ||
| - | * PLUGIN_LIST_DATABASE | ||
| * preoperation | * preoperation | ||
| * postoperation | * postoperation | ||
| Line 36: | Line 35: | ||
| * matchingrule | * matchingrule | ||
| * syntax | * syntax | ||
| - | * PLUGIN_LIST_ENTRY | ||
| * object | * object | ||
| * pwdstoragescheme | * pwdstoragescheme | ||
| Line 43: | Line 41: | ||
| * ldbmentryfetchstore | * ldbmentryfetchstore | ||
| * index | * index | ||
| + | |||
| + | It should be noted that the ability to set a precedence doesn't make sense for all of the plug-in types. Some examples of where precedence do not make sense are the syntax, matchingrule, and extendedop plug-in types, since these are implementing callbacks to add support for specific datatypes or operations. The types where precedence is really desirable are for the six preoperation and postoperation plug-in types. | ||
| == Implementation == | == Implementation == | ||
Revision as of 19:47, 2 November 2009
This document describes the design and implementation of a feature to allow Plug-in execution order to be defined.
Background
The current implementation of the SLAPI plug-in interface does not allow the execution order of plug-ins to be defined within the same plug-in type. It would be useful to plug-in developers to be able to define an order for plug-in execution. This would allow for more complex plug-in interaction, such as having a pre-operation plug-in that relies on another pre-operation plug-in completing it's job first.
Design
To define plug-in execution order, it will be possible to set a plug-in precedence in a plug-in configuration entry. This precedence value will then be used to determine the order in which to call the plug-ins within a given plug-in type. The precedence will be defined as an integer value between 00-99 with 00 being the highest priority and 99 being the lowest priority. The precedence value will be stored in the nsslapd-pluginPrecedence attribute within a plug-in configuration entry. If the precedence attribute is not set for a particular plug-in, the value will default to 50 internally. Here is an example configuration entry:
dn: cn=ACL Plugin,cn=plugins,cn=config objectClass: top objectClass: nsSlapdPlugin objectClass: extensibleObject cn: ACL Plugin nsslapd-pluginPath: libacl-plugin nsslapd-pluginInitfunc: acl_init nsslapd-pluginType: accesscontrol nsslapd-pluginEnabled: on nsslapd-plugin-depends-on-type: database nsslapd-pluginId: acl nsslapd-pluginVersion: 1.2.3 nsslapd-pluginVendor: 389 Project nsslapd-pluginDescription: acl access check plugin nsslapd-pluginPrecedence: 50
The precedence of a plug-in will only order plug-ins within the same plug-in type. The available plug-in types are:
- preoperation
- postoperation
- bepreoperation
- bepostoperation
- internalpreoperation
- internalpostoperation
- extendedop
- accesscontrol
- matchingrule
- syntax
- object
- pwdstoragescheme
- reverpwdstoragescheme
- vattrsp
- ldbmentryfetchstore
- index
It should be noted that the ability to set a precedence doesn't make sense for all of the plug-in types. Some examples of where precedence do not make sense are the syntax, matchingrule, and extendedop plug-in types, since these are implementing callbacks to add support for specific datatypes or operations. The types where precedence is really desirable are for the six preoperation and postoperation plug-in types.
