Details
-
Improvement
-
Resolution: Fixed
-
Major
-
7.0-milestone-2
-
None
Description
Right now, all MandatoryDocumentInitializers are executed at the same level, in a random order. However, it may be the case when one document initializer needs to be execute before or after another.
Examples:
- Both the Class document and a couple of instances are mandatory documents, but the instances need to be initialized after the class and not before.
- Mandatory class document defines a StrigList property for which possible values need to be determined to a list of document, but those documents are themselves mandatory documents as well. This class can not be initialized before the mandatory document "dependencies" are initialized.
- etc.
The simplest way would be to use a @Priority annotation on the components and then sorting the initializes based on this priority.
For the @Priority annotation, javax.annotation could be used which contains some general purpose annotations such as this one.
This also has the benefit that it does not influence in any way existing implementations, as thy can be considered as having all the same default priority of, say, 1000.
Attachments
Issue Links
- blocks
-
XWIKI-11760 Convert the WatchList plugin to a component
- Closed