|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AvailabilityContext
Resource specific context through which to make availability related calls back into the plugin container.
Method Summary | |
---|---|
AvailabilityCollectorRunnable |
createAvailabilityCollectorRunnable(AvailabilityFacet availChecker,
long interval)
Under certain circumstances, a resource component may want to perform asynchronous availability checks, as opposed to AvailabilityFacet.getAvailability() blocking waiting for the managed resource to return
its availability status. |
void |
disable()
This method allows the component to request the server set the resource DISABLED in the same way that a user can set a resource DISABLED. |
void |
enable()
This method allows the component to request the server set the resource ENABLED in the same way that a user can set a resource ENABLED. |
AvailabilityType |
getLastReportedAvailability()
This method will return the last reported AvailabilityType, which can be null if not yet reported. |
void |
requestAvailabilityCheck()
The plugin container (PC) checks resource availability based on the collection interval on the {code}AvailabilityType{code} metric. |
Method Detail |
---|
AvailabilityCollectorRunnable createAvailabilityCollectorRunnable(AvailabilityFacet availChecker, long interval)
AvailabilityFacet.getAvailability()
blocking waiting for the managed resource to return
its availability status. Using asynchronous availability checking frees the resource component from having
to guarantee that the managed resource will provide availability status in a timely fashion.
If the resource component needs to perform asynchronous availability checking, it should call this
method to create an instance of AvailabilityCollectorRunnable
inside the ResourceComponent.start(org.rhq.core.pluginapi.inventory.ResourceContext)
method.
It should then call the returned object's AvailabilityCollectorRunnable.start()
method within the same resource
component ResourceComponent.start(ResourceContext)
method. The resource component should call the
AvailabilityCollectorRunnable.stop()
method when the resource component
stops
. The resource component's AvailabilityFacet.getAvailability()
method
should simply return the value returned by AvailabilityCollectorRunnable.getLastKnownAvailability()
. This
method will be extremely fast since it simply returns the last availability that was retrieved by the
given availability checker. Only when the availability checker finishes checking for availability of the managed resource
(however long it takes to do so) will the last known availability state change.
For more information, read the javadoc in AvailabilityCollectorRunnable
.
availChecker
- the object that will perform the actual check of the managed resource's availabilityinterval
- the interval, in milliseconds, between availability checks. The minimum value allowed
for this parameter is AvailabilityCollectorRunnable.MIN_INTERVAL
.
void requestAvailabilityCheck()
AvailabilityType getLastReportedAvailability()
AvailabilityFacet.getAvailability()
, raher it will return
the result of the most recent call to that method, made by the plugin container.
void disable()
#enable()}
void enable()
#disable()}
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |