modules/core/plugin-container/src/main/java/org/rhq/core/pc/util/DiscoveryComponentProxyFactory.java | 11 ++++++++++ 1 file changed, 11 insertions(+)
New commits: commit 614c84652bb5dde7cf00068825584dc479737cdf Author: Jirka Kremser jkremser@redhat.com Date: Mon Aug 26 16:32:53 2013 +0200
Adding a way to disable the blacklising of resource types during the discovery. This can be handy when debugging the discovery process.
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/util/DiscoveryComponentProxyFactory.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/util/DiscoveryComponentProxyFactory.java index ac465a6..43b5203 100644 --- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/util/DiscoveryComponentProxyFactory.java +++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/util/DiscoveryComponentProxyFactory.java @@ -66,6 +66,15 @@ public class DiscoveryComponentProxyFactory { private static final String DAEMON_THREAD_POOL_NAME = "ResourceDiscoveryComponent.invoker.daemon"; private ExecutorService daemonThreadPool = null; private final Set<ResourceType> blacklist = new HashSet<ResourceType>(); + private static boolean blacklistDisable; + static { + try { + blacklistDisable = Boolean.valueOf(System.getProperty("rhq.agent.blacklist.disable", "false")); + } catch (Throwable t) { + blacklistDisable = false; + } // always catch here, always let the class load, use a default if the sysprop is invalid + } +
/** * Same as {@link #getDiscoveryComponentProxy(org.rhq.core.domain.resource.ResourceType, org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent, long, org.rhq.core.pc.inventory.ResourceContainer)} except @@ -152,12 +161,14 @@ public class DiscoveryComponentProxyFactory { }
public boolean isResourceTypeBlacklisted(ResourceType type) { + if (blacklistDisable) return false; synchronized (this.blacklist) { return this.blacklist.contains(type); } }
public void addResourceTypeToBlacklist(ResourceType type) { + if (blacklistDisable) return; synchronized (this.blacklist) { this.blacklist.add(type); }