This repository has been archived by the owner on Jan 29, 2020. It is now read-only.
Do not raise an exception if a given plugin manager is not defined. #36
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
ServiceListener::onLoadModulesPost()
listener raises an exception if a given plugin manager instance is unavailable, and does not exist in the application service manager. This impacts migrating the various plugin managers to their respective components:ServiceListener
from component module classes, as theServiceListener
is retrieved before loading modules.One solution is to assume that if the plugin manager is not present, nothing needs to be done. This allows components to map the plugin loader services they expose via their
Module
classes, ensuring that once the listener triggers, it can access the service and configure it.Incidentally, there is also a solution to components notifying the
ServiceListener
of plugin manager specifications already, via theinit()
method. As an example:As components are expected to be listed early in the module list, this approach should be robust enough to ensure userland and third party modules (not components) registered later can configure the plugin manager.
The patch submitted ensures that in the off chance that a plugin manager is registered but has no service associated with it, exceptions need not be thrown.