org.rhq.core.pluginapi.inventory
Interface ResourceDiscoveryComponent<T extends ResourceComponent>

Type Parameters:
T - the parent resource component type for those resources discovered by this discovery component

public interface ResourceDiscoveryComponent<T extends ResourceComponent>

The plugin component that defines how resources are discovered. If an implementation of this interface declares its resource component T, that means that discovery component implementation can discover child resources for that type T parent resource. This means you can nest a hierarchy of discovery components that mimic the resource type hierarchy as defined in a plugin deployment descriptor.

For example, a discovery component that can discover JBossAS data source services would declare its type T as being the JBossAS server resource component (since JBossAS server resources can have children of type "data source service".


Method Summary
 Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<T> context)
          Asks the discovery component to discover all of its resources.
 

Method Detail

discoverResources

Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<T> context)
                                                 throws InvalidPluginConfigurationException,
                                                        Exception
Asks the discovery component to discover all of its resources. The plugin container may or may not have already auto-discovered some resources for this component already. In this case, this discovery component should take those auto-discovered resources from the context and "prepare them" to be included as part of the returned set of resources, unless there is some reason it doesn't want to include those resources. By "prepare them", it means to make sure to set their key, name and other details.

Parameters:
context - the discovery context that provides the information to the component that helps it perform its discovery
Returns:
a set of discovered resource details that were discovered and can be imported/merged into inventory
Throws:
InvalidPluginConfigurationException - if a plugin configuration found in the context was somehow invalid and thus caused a failure to connect to a resource
Exception - if a generic error occurred that caused the discovery to abort


Copyright © 2008 RHQ Project Advisory Board (Red Hat, Inc. and Hyperic, Inc.). All Rights Reserved.