public abstract class PlatformDiscoveryComponent extends Object implements ResourceDiscoveryComponent
| Constructor and Description |
|---|
PlatformDiscoveryComponent() |
| Modifier and Type | Method and Description |
|---|---|
protected String |
determineResourceKey(ResourceDiscoveryContext context)
This will determine what the new platform's resource key should be.
|
protected String |
determineResourceName(ResourceDiscoveryContext context)
This will determine what the new platform's resource name should be.
|
protected void |
discoverConfiguration(org.rhq.core.domain.configuration.Configuration configuration)
Override this method to add additional configurations to discovered platforms
|
Set<DiscoveredResourceDetails> |
discoverResources(ResourceDiscoveryContext context)
This will build the platform's resource details, where its name and key are by default
the plugin container's name.
|
protected String |
getHostname(SystemInfo systemInformation)
Tries to determine this platform's hostname, using the (possibly native)
system info API.
|
protected abstract boolean |
isPlatformSupported(ResourceDiscoveryContext context)
Subclasses will implement this method to tell this class whether or not it can discover the platform of the
resource type found in the given context.
|
public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext context)
discoverResources in interface ResourceDiscoveryComponentResourceDiscoveryComponent.discoverResources(ResourceDiscoveryContext)protected void discoverConfiguration(org.rhq.core.domain.configuration.Configuration configuration)
configuration - protected String determineResourceKey(ResourceDiscoveryContext context)
null, the platform's hostname is used. This is less than optimal
but the plugin container's name will never be null under virtually
all use-cases (except perhaps in test scenarios).context - the discovery context used to get the plugin container name or host name if its neededprotected String determineResourceName(ResourceDiscoveryContext context)
null, the platform's hostname is used.context - the discovery context used to get the plugin container name or host name if its neededprotected String getHostname(SystemInfo systemInformation)
systemInformation - null)protected abstract boolean isPlatformSupported(ResourceDiscoveryContext context)
false, this subclass discovery component
instance does not recognize the platform.
It is very important that all subclasses must return false except one for any given
platform. That is to say, if running on "RHEL 5", only the subclass that supports RHEL 5 must return
true, all others must return false. If running on "Windows XP", only the suclass that
supports Windows XP must return true. The only exception to this rule is the
fallback Java platform discovery component, which will always return
true because the fallback Java platform is always supported.
context - true if this instance can support the platform this plugin is running on; false
otherwiseCopyright © 2008-2013 Red Hat, Inc.. All Rights Reserved.