Bug 534309 - (RHQ-1118) Add a new discoveryScanId field to ResourceDiscoveryContext to allow plugins to do something once per scan
Add a new discoveryScanId field to ResourceDiscoveryContext to allow plugins ...
Product: RHQ Project
Classification: Other
Component: Plugin Container (Show other bugs)
All All
medium Severity medium (vote)
: ---
: ---
Assigned To: RHQ Project Maintainer
: FutureFeature, Improvement
Depends On:
  Show dependency treegraph
Reported: 2008-11-13 13:30 EST by Ian Springer
Modified: 2014-05-02 16:18 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-05-02 16:18:03 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Ian Springer 2008-11-13 13:30:00 EST
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.
Comment 1 Red Hat Bugzilla 2009-11-10 15:24:20 EST
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-1118
Comment 2 wes hayutin 2010-02-16 12:08:30 EST
mass add of key word FutureFeature to help track
Comment 3 Corey Welton 2010-08-18 11:16:31 EDT
ian, is this still an issue?
Comment 4 Ian Springer 2012-06-28 11:04:19 EDT
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);


Note You need to log in before you can comment on or make changes to this bug.