Bug 725740 - [RFE] enable loadResourceConfiguration() to report failure state in a non-invasive way
Summary: [RFE] enable loadResourceConfiguration() to report failure state in a non-inv...
Keywords:
Status: NEW
Alias: None
Product: RHQ Project
Classification: Other
Component: Plugin Container
Version: 4.1
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: ---
: ---
Assignee: Nobody
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-07-26 12:37 UTC by Lukas Krejci
Modified: 2022-03-31 04:27 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description Lukas Krejci 2011-07-26 12:37:19 UTC
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 12:56:00 UTC
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.