This guide provides information about the option to process the metadata bundles with additional synchronization to prevent potential metadata conflicts. Defined are the topics for events, indicating for logs or new configurations being created.
Concept
Metatype configuration loader is a feature that processes bundle metadata and creates OSGi configurations, based on this data.
All bundles must be scanned for metadata.
On startup of metatype configuration loader, there are two operations:
The second operation may take a lot of time potentially. So it is better to use a separate thread, instead of performing it synchronously, while activating metatype bundle.
Potential problems
Asynchronous processing of OSGi metadata can cause conflicts with bundle update operations, metadata update in particular. This may lead to loading data from a bundle in inconsistent state and preventing a parallel update of metadata operation.
So it is better to have an option to implement some additional synchronization.
Solution
For the purposes of allowing user to implement some synchronization with metatype configuration loader, OSGi events are dispatched, using Event Admin service. Each event indicates the current status of processing metadata from already installed bundles.
The following topics are defined, to indicate the status of the operations:
It is recommended that bundle update metadata operations are performed after either com/prosyst/mbs/services/metatype/LOADER_PROCESSING_FINISHED or com/prosyst/mbs/services/metatype/LOADER_PROCESSING_FINISHED_NO_CHANGES event is received.
This means that no more bundles are being processed and there is no reason for potential metadata conflicts.