Bug 534309 (RHQ-1118) - Add a new discoveryScanId field to ResourceDiscoveryContext to allow plugins to do something once per scan
Summary: Add a new discoveryScanId field to ResourceDiscoveryContext to allow plugins ...
Keywords:
Status: CLOSED WONTFIX
Alias: RHQ-1118
Product: RHQ Project
Classification: Other
Component: Plugin Container
Version: 4.4
Hardware: All
OS: All
medium
medium
Target Milestone: ---
: ---
Assignee: RHQ Project Maintainer
QA Contact:
URL: http://jira.rhq-project.org/browse/RH...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-11-13 18:30 UTC by Ian Springer
Modified: 2014-05-02 20:18 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-05-02 20:18:03 UTC
Embargoed:


Attachments (Terms of Use)

Description Ian Springer 2008-11-13 18:30:00 UTC
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 20:24:20 UTC
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-1118


Comment 2 wes hayutin 2010-02-16 17:08:30 UTC
mass add of key word FutureFeature to help track

Comment 3 Corey Welton 2010-08-18 15:16:31 UTC
ian, is this still an issue?

Comment 4 Ian Springer 2012-06-28 15:04:19 UTC
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.