org.rhq.core.pc.inventory
Class AvailabilityExecutor

java.lang.Object
  extended by org.rhq.core.pc.inventory.AvailabilityExecutor
All Implemented Interfaces:
Runnable, Callable<org.rhq.core.domain.discovery.AvailabilityReport>

public class AvailabilityExecutor
extends Object
implements Runnable, Callable<org.rhq.core.domain.discovery.AvailabilityReport>

Runs a periodic scan for resource availability.

Author:
Greg Hinkle, John Mazzitelli, Ian Springer

Constructor Summary
AvailabilityExecutor(InventoryManager inventoryManager)
           
 
Method Summary
 org.rhq.core.domain.discovery.AvailabilityReport call()
          Returns the availability report that should be sent to the Server.
 void run()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AvailabilityExecutor

public AvailabilityExecutor(InventoryManager inventoryManager)
Method Detail

run

public void run()
Specified by:
run in interface Runnable

call

public org.rhq.core.domain.discovery.AvailabilityReport call()
                                                      throws Exception
Returns the availability report that should be sent to the Server.

This will return null if there is no committed inventory and thus no availability reports should be sent. This will rarely happen - only if this is a brand new agent whose inventory hasn't been committed yet or if the platform and all its children have been deleted (in which case the agent should be uninstalled, or the user will want to re-import the platform). In either case, it will be in rare, corner cases that this will ever return null, and the condition that caused the null should eventually go away.

Specified by:
call in interface Callable<org.rhq.core.domain.discovery.AvailabilityReport>
Returns:
the report containing all the availabilities that need to be sent to the Server, or null if there is no committed inventory and thus no availability reports should be sent
Throws:
Exception - if failed to create and prepare the report


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.