modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseServerComponent.java
| 19 +++++-----
1 file changed, 10 insertions(+), 9 deletions(-)
New commits:
commit dfc792f515525c337650a692fb80f13b986fdc10
Author: Thomas Segismont <tsegismo(a)redhat.com>
Date: Thu Jan 30 18:56:02 2014 +0100
Do not catch an exception just thrown
diff --git
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseServerComponent.java
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseServerComponent.java
index bc7112a..7654c62 100644
---
a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseServerComponent.java
+++
b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseServerComponent.java
@@ -181,20 +181,21 @@ public abstract class BaseServerComponent<T extends
ResourceComponent<?>> extend
// Validate the product type (e.g. AS or EAP).
String expectedRuntimeProductName =
pluginConfiguration.getSimpleValue("expectedRuntimeProductName");
+ String runtimeProductName;
try {
- String runtimeProductName = readAttribute(getHostAddress(),
"product-name");
- if (runtimeProductName == null || runtimeProductName.trim().isEmpty()) {
- runtimeProductName = JBossProductType.AS.PRODUCT_NAME;
- }
- if (!runtimeProductName.equals(expectedRuntimeProductName)) {
- throw new InvalidPluginConfigurationException(
- "The original product type discovered for this server was "
+ expectedRuntimeProductName
- + ", but the server is now reporting its product type is
[" + runtimeProductName + "]");
- }
+ runtimeProductName = readAttribute(getHostAddress(),
"product-name");
} catch (Exception e) {
throw new InvalidPluginConfigurationException("Failed to validate
product type for "
+ getResourceDescription(), e);
}
+ if (runtimeProductName == null || runtimeProductName.trim().isEmpty()) {
+ runtimeProductName = JBossProductType.AS.PRODUCT_NAME;
+ }
+ if (!runtimeProductName.equals(expectedRuntimeProductName)) {
+ throw new InvalidPluginConfigurationException(
+ "The original product type discovered for this server was "
+ expectedRuntimeProductName
+ + ", but the server is now reporting its product type is
[" + runtimeProductName + "]");
+ }
}
public ServerPluginConfiguration getServerPluginConfiguration() {
Show replies by date