Red Hat Bugzilla – Bug 725740
[RFE] enable loadResourceConfiguration() to report failure state in a non-invasive way
Last modified: 2011-10-06 15:02:04 EDT
Description of problem:
Currently, the ConfigurationFacet.loadResourceConfiguration() implementors don't have many options on how to report why a configuration load failed:
1) They can return null suggesting that the configuration is somehow "disabled" (using plugin configuration)
2) They can throw runtime exception suggesting that the loading failed in an unexpected manner.
I think we should add the ability to report why the configuration loading didn't succeed. This is to cover the scenarios where there are multiple possible reasons for the config to not load and the plugin writer would like to inform the user which one of them it was.
I propose to create a new RuntimeException: ConfigurationUnavailableException that the ConfigurationFacet.loadResourceConfiguration() could throw that would be handled specially by the plugin container and the UI. The plugin container would log such exceptions because they are not completely unexcepted by the plugin and therefore there is no need for the verbose logging and the UI could display the message of such exception to the user so that they can be better informed why the configuration failed to load.
Actually there is more to this, as in case of success additional information can also not be returned outside the configuration.
E.g in the as7 plugin I would need to tell the user in some situations that he now needs to reload the server configuration after a change