Bug 725740 - [RFE] enable loadResourceConfiguration() to report failure state in a non-invasive way
[RFE] enable loadResourceConfiguration() to report failure state in a non-inv...
Status: NEW
Product: RHQ Project
Classification: Other
Component: Plugin Container (Show other bugs)
4.1
Unspecified Unspecified
medium Severity unspecified (vote)
: ---
: ---
Assigned To: RHQ Project Maintainer
Mike Foley
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-07-26 08:37 EDT by Lukas Krejci
Modified: 2011-10-06 15:02 EDT (History)
1 user (show)

See Also:
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: ---


Attachments (Terms of Use)

  None (edit)
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

Note You need to log in before you can comment on or make changes to this bug.