Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

Commit

Permalink
Merge branch 'RHQ_4_4_0_JON312GA/bug/1203469' into hotfix/jon3.1.2
Browse files Browse the repository at this point in the history
This allows AS7 based products to be discovered as AS instances in the event they are for unknown or unsupported product slots.
  • Loading branch information
loleary committed Apr 27, 2015
2 parents dbab118 + 29b503b commit 03caa62
Showing 1 changed file with 18 additions and 5 deletions.
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
* Copyright (C) 2005-2012 Red Hat, Inc.
* Copyright (C) 2011-2015 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
Expand All @@ -13,8 +13,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* along with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.modules.plugins.jbossas7;

Expand Down Expand Up @@ -190,7 +190,12 @@ protected DiscoveredResourceDetails buildResourceDetails(ResourceDiscoveryContex
serverPluginConfig.setHostname(managementHostPort.host);
serverPluginConfig.setPort(managementHostPort.port);
pluginConfig.setSimpleValue("realm", hostConfig.getManagementSecurityRealm());
JBossProductType productType = JBossProductType.determineJBossProductType(homeDir);
JBossProductType productType = JBossProductType.AS;
try {
JBossProductType.determineJBossProductType(homeDir);
} catch (Exception e) {
log.warn("Managed product type for [" + homeDir + "] could not be determined or is unsupported: " + e.getMessage(), e); //$NON-NLS-1$ //$NON-NLS-2$
}
serverPluginConfig.setProductType(productType);
pluginConfig.setSimpleValue("hostXmlFileName", getHostXmlFileName(commandLine));

Expand Down Expand Up @@ -604,8 +609,16 @@ public ProductInfo getFromRemote() {
ASConnection connection = new ASConnection(hostname, port, user, pass);
try {
String productName = getServerAttribute(connection, "product-name");
productType = ((productName != null) && !productName.isEmpty()) ?
try {
productType = ((productName != null) && !productName.isEmpty()) ?
JBossProductType.getValueByProductName(productName) : JBossProductType.AS;
} catch (Exception e) {
// if the product type can not be determined, log a warning
// to indicate that the product may not be supported and
// fall back to a product type of AS.
log.warn("Unknown or unsupported product type for product [" + productName + "]: " + e.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
productType = JBossProductType.AS;
}
releaseVersion = getServerAttribute(connection, "release-version");
releaseCodeName = getServerAttribute(connection, "release-codename");
serverName = getServerAttribute(connection, "name");
Expand Down

0 comments on commit 03caa62

Please sign in to comment.