Bug 725740

Summary: [RFE] enable loadResourceConfiguration() to report failure state in a non-invasive way
Product: [Other] RHQ Project Reporter: Lukas Krejci <lkrejci>
Component: Plugin ContainerAssignee: RHQ Project Maintainer <rhq-maint>
Status: NEW --- QA Contact: Mike Foley <mfoley>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 4.1CC: hrupp
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Lukas Krejci 2011-07-26 08:37:19 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.
Comment 1 Heiko W. Rupp 2011-07-26 08:56:00 EDT
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