org.rhq.plugins.script
Class ScriptDiscoveryComponent

java.lang.Object
  extended by org.rhq.plugins.script.ScriptDiscoveryComponent
All Implemented Interfaces:
ManualAddFacet, ResourceDiscoveryComponent

public class ScriptDiscoveryComponent
extends Object
implements ResourceDiscoveryComponent, ManualAddFacet

Discovery component that allows you to manually add your own CLI-managed resource, where the CLI is some executable binary or script. The CLI executable/script itself is not the managed resource, it is merely the management front end to the actual managed resource.

Author:
John Mazzitelli

Constructor Summary
ScriptDiscoveryComponent()
           
 
Method Summary
protected  String determineDescription(ResourceDiscoveryContext context, Configuration pluginConfig)
          Attempts to determine the description of the resource managed by the CLI.
protected  String determineVersion(ResourceDiscoveryContext context, Configuration pluginConfig)
          Attempts to determine the version of the resource managed by the CLI.
 DiscoveredResourceDetails discoverResource(Configuration pluginConfig, ResourceDiscoveryContext discoveryContext)
           
 Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext context)
           
protected  DiscoveredResourceDetails processAutoDiscoveredResource(ResourceDiscoveryContext context, ProcessScanResult autoDiscoveryResult)
          Subclasses should override this method if their plugin descriptors defined process scans.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScriptDiscoveryComponent

public ScriptDiscoveryComponent()
Method Detail

discoverResources

public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext context)
Specified by:
discoverResources in interface ResourceDiscoveryComponent

discoverResource

public DiscoveredResourceDetails discoverResource(Configuration pluginConfig,
                                                  ResourceDiscoveryContext discoveryContext)
                                           throws InvalidPluginConfigurationException
Specified by:
discoverResource in interface ManualAddFacet
Throws:
InvalidPluginConfigurationException

processAutoDiscoveredResource

protected DiscoveredResourceDetails processAutoDiscoveredResource(ResourceDiscoveryContext context,
                                                                  ProcessScanResult autoDiscoveryResult)
Subclasses should override this method if their plugin descriptors defined process scans. This method is called for each process that was discovered that matched a process scan. Implementors must return a details object that represents the discovered resource. If this returns null, this process will be ignored and no resource will be discovered.

Parameters:
context - the discovery context
autoDiscoveryResult - information on the discovered process
Returns:
the details object that represents the discovered resource

determineDescription

protected String determineDescription(ResourceDiscoveryContext context,
                                      Configuration pluginConfig)
Attempts to determine the description of the resource managed by the CLI.

Parameters:
context -
pluginConfig -
Returns:
the description or null if it could not be determined

determineVersion

protected String determineVersion(ResourceDiscoveryContext context,
                                  Configuration pluginConfig)
Attempts to determine the version of the resource managed by the CLI.

Parameters:
context -
pluginConfig -
Returns:
the version or null if it could not be determined


Copyright © 2008-2011 Red Hat, Inc.. All Rights Reserved.