modules/plugins/platform/src/main/java/org/rhq/plugins/platform/PlatformDiscoveryComponent.java | 4 +-- modules/plugins/platform/src/main/java/org/rhq/plugins/platform/ProcessDiscoveryComponent.java | 11 ++++++---- 2 files changed, 9 insertions(+), 6 deletions(-)
New commits: commit 5c0202533709fe382b7db4d10c7d55834f9400c4 Author: Ian Springer ian.springer@redhat.com Date: Mon Jan 23 21:20:11 2012 -0500
if an exception occurs when discoverResource() calls ProcessComponent.getProcessForConfiguration(), include it as the cause of the RuntimeException that is thrown, rather than swallowing it; set a description on the details object returned by discoverResource()
diff --git a/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/ProcessDiscoveryComponent.java b/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/ProcessDiscoveryComponent.java index f30f923..1f506aa 100644 --- a/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/ProcessDiscoveryComponent.java +++ b/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/ProcessDiscoveryComponent.java @@ -1,6 +1,6 @@ /* * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. + * Copyright (C) 2005-2012 Red Hat, Inc. * All rights reserved. * * This program is free software; you can redistribute it and/or modify @@ -52,22 +52,25 @@ public class ProcessDiscoveryComponent implements ResourceDiscoveryComponent, Ma resourceDiscoveryContext.getSystemInformation()); } catch (Exception e) { - throw new RuntimeException("Failed to create process based on plugin config: " + pluginConfig); + throw new RuntimeException("Failed to manually add process Resource based on plugin config: " + + pluginConfig.toString(true), e); }
String type = pluginConfig.getSimpleValue("type", "pidFile"); String resourceKey = pluginConfig.getSimpleValue(type, null); if (resourceKey == null || resourceKey.length() == 0) { - throw new InvalidPluginConfigurationException("Invalid type [" + type + "] value [" + resourceKey + "]"); + throw new InvalidPluginConfigurationException("Invalid type [" + type + "] value: [" + resourceKey + "]"); }
ResourceType resourceType = resourceDiscoveryContext.getResourceType(); String resourceName = processInfo.getBaseName(); String resourceVersion = null; - String resourceDescription = null; + String resourceDescription = processInfo.getBaseName() + " process with " + + (type.equals("pidFile") ? "PID file" : "PIQL expression") + " [" + resourceKey + "]";
DiscoveredResourceDetails detail = new DiscoveredResourceDetails(resourceType, resourceKey, resourceName, resourceVersion, resourceDescription, pluginConfig, processInfo); return detail; } + }
commit dbe929c0ce98c4acb513a9c35dd94113f309a7ea Author: Ian Springer ian.springer@redhat.com Date: Mon Jan 23 21:17:18 2012 -0500
fix generics-related compiler warning
diff --git a/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/PlatformDiscoveryComponent.java b/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/PlatformDiscoveryComponent.java index d7e9ef9..e795810 100644 --- a/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/PlatformDiscoveryComponent.java +++ b/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/PlatformDiscoveryComponent.java @@ -1,4 +1,4 @@ - /* +/* * RHQ Management Platform * Copyright (C) 2005-2008 Red Hat, Inc. * All rights reserved. @@ -51,7 +51,7 @@ public abstract class PlatformDiscoveryComponent implements ResourceDiscoveryCom */ public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext context) { if (!isPlatformSupported(context)) { - return Collections.EMPTY_SET; + return Collections.emptySet(); }
SystemInfo systemInfo = context.getSystemInformation();
rhq-commits@lists.fedorahosted.org