The use case for this is the AS5 plugin. It uses the profile service to retrieve a ManagementView, which is a snapshot of the management info for a particular profile at a particular point in time. Since it is a point in time snapshot, the ManagementView needs to be refreshed periodically; this is done by calling loadProfile() on it. For runtime discoveries, it is vital to refresh the view prior to the discovery, so that any managed components that were deployed since the last time the ManagementView was refreshed will get discovered. We currently refresh the view at the top of JndiResourceDiscoveryComponent.discoverResources() and DeploymentResourceDiscoveryComponent.discoverResources(), but we really only need to refresh the view at the very beginning of a runtime scan, not for each service type that is scanned for. And doing it once per scan is better, particularly for the Embedded Console, because refreshing the view is presumably a fairly expensive operation. The problem is the ResourceDiscoveryComponent.discoverResources() currently has no API provided that allows it to ascertain the scan that called it. I propose adding a new discoveryScanId integer field to ResourceDiscoveryContext. This would be set to a unique value by the PluginContainer for each scan it executes.
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-1118
mass add of key word FutureFeature to help track
ian, is this still an issue?
Note an alternative to the scan ID would be a new facet interface that discovery components could optionally implement, e.g.: public interface DiscoveryScanListener { void discoveryScanStarted(ScanInfo scanInfo); void discoveryScanEnded(ScanInfo scanInfo); }