[rhq] Branch 'stefan/inventorycontext' - modules/core

snegrea snegrea at fedoraproject.org
Tue Aug 7 19:45:43 UTC 2012


 modules/core/plugin-api/src/main/java/org/rhq/core/pluginapi/inventory/InventoryContext.java    |   11 ++++------
 modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryContextImpl.java |    5 +---
 2 files changed, 7 insertions(+), 9 deletions(-)

New commits:
commit 7f5aa39c22688ee935b23d2dad767ff03c41dc96
Author: Stefan Negrea <snegrea at redhat.com>
Date:   Tue Aug 7 14:45:31 2012 -0500

    [BZ 828329] Removed plugin container specific classes. The regular will just block until the discovery processes completes, no data is returned to caller.

diff --git a/modules/core/plugin-api/src/main/java/org/rhq/core/pluginapi/inventory/InventoryContext.java b/modules/core/plugin-api/src/main/java/org/rhq/core/pluginapi/inventory/InventoryContext.java
index 5ae11eb..50a7945 100644
--- a/modules/core/plugin-api/src/main/java/org/rhq/core/pluginapi/inventory/InventoryContext.java
+++ b/modules/core/plugin-api/src/main/java/org/rhq/core/pluginapi/inventory/InventoryContext.java
@@ -20,7 +20,6 @@
 
 package org.rhq.core.pluginapi.inventory;
 
-import org.rhq.core.clientapi.server.discovery.InventoryReport;
 
 /**
  * @author Stefan Negrea
@@ -46,14 +45,14 @@ public interface InventoryContext {
 
     /**
      * This method requests a service discovery process for children of the resource. It schedules the discovery
-     * process and returns the results of the discovery. The discovery process inventories all discovered
+     * process and blocks until the discovery finishes. The discovery process inventories all discovered
      * resources, so no further action is required.
      *
      * This method should be used by resources following an action (outside of create/delete children) that results
      * in having additional children discoverable. A good example is an operation execution that enables extra functionality
-     * on the managed resource which in turn translates into having additional children available for management. This method returns
-     * the results of the discovery to allow for additional processing, however all discovered resources are already
-     * committed to the inventory before returning the results.
+     * on the managed resource which in turn translates into having additional children available for management. This method blocks
+     * until the discovery processes finishes, this includes committing resources to inventory. For additional processing,
+     * the calling resource can then request the list of child resources (it will include newly discovered resources too).
      *
      * Note: All resources are discovered by the regular platform level discovery process that runs every 24 hours. This method allows
      * a resource to request a discovery for child resources to be run immediately, rather than wait for the scheduled platform
@@ -61,6 +60,6 @@ public interface InventoryContext {
      *
      * @return discovered child resources
      */
-    public InventoryReport requestChildResourcesDiscovery();
+    public void requestChildResourcesDiscovery();
 
 }
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryContextImpl.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryContextImpl.java
index b14792d..460a827 100644
--- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryContextImpl.java
+++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryContextImpl.java
@@ -20,7 +20,6 @@
 
 package org.rhq.core.pc.inventory;
 
-import org.rhq.core.clientapi.server.discovery.InventoryReport;
 import org.rhq.core.domain.resource.Resource;
 import org.rhq.core.pc.PluginContainer;
 import org.rhq.core.pluginapi.inventory.InventoryContext;
@@ -52,7 +51,7 @@ public class InventoryContextImpl implements InventoryContext {
      * @see org.rhq.core.pluginapi.inventory.InventoryContext#requestChildResourcesDiscovery()
      */
     @Override
-    public InventoryReport requestChildResourcesDiscovery() {
-        return PluginContainer.getInstance().getInventoryManager().executeServiceScanImmediately(resource);
+    public void requestChildResourcesDiscovery() {
+        PluginContainer.getInstance().getInventoryManager().executeServiceScanImmediately(resource);
     }
 }




More information about the rhq-commits mailing list