By default listens for all Assets (please override
createAssetCallback to make more specific).
Also listens for allocations.
Fill in empty functions as needed to add functionality
Abstract because these are undefined:
processTasks -- different for each plugin flavor
Override to replace with a callback that has a different predicate
or different behaviour when triggered.
PLEASE override this -- this is mainly here for backward compatibility.
I.e.
Implemented for UTILAllocationListener
Called automatically by the UTILAllocationCallback
if the allocation has changed but it does NOT need
to be rescinded.
The idea is to add subscriptions (via the filterCallback), and when
they change, to have the callback react to the change, and tell
the listener (many times the plugin) what to do.
Override to replace with a callback that has a different predicate
or different behaviour when triggered.
PLEASE override this -- this is mainly here for backward compatibility.
I.e. we shouldn't get all the assets of the cluster and then iterate over
them, testing them with instanceof to get the assets we want. We should
use a more specific callback filter/predicate.
Provide the callback that is paired with the buffering thread, which is a
listener. The buffering thread is the listener to the callback
a WorkflowCallback with the buffering thread as its listener
Utility method for finding all resource assets.
In general, it would be better if plugins could use more
specific filters and so this call would return a restricted set of
assets.
At the very least,
cluster assets can be divided between organizational assets
and physical assets.
Enumeration of ALL assets found in container
Called when an allocation is removed from the cluster.
I.e. an upstream cluster removed an allocation, and this
rescind has resulted in this allocation being removed.
If the plugin maintains some local state of the availability
of assets, it should update them here.
Does nothing by default.
Implemented for UTILAllocationListener
Defines re-allocation of a rescinded task.
Overriders need to take into consideration that
the asset chosen last time is not available this time.
Note that updateAllocationResult is called automatically by
the UTILAllocationCallback if the allocation has changed
(typically if its allocation result has changed)
but it does NOT need to be rescinded.
Called by UTILAllocationCallback.reactToChangedAlloc.
Only called when needToRescind returns TRUE.
See comment on needToRescind.
Does nothing by default.
Implemented for UTILAllocationListener
Called automatically by the UTILAllocationCallback
if the allocation has changed but it does NOT need
to be rescinded.
updateAllocationResult is called first and then this method
gets called.
Called by UTILAllocationCallback.reactToChangedAlloc.
Only called when needToRescind returns FALSE.
See comment on needToRescind.
Does nothing by default.
Implemented for UTILAllocationListener
Defines conditions for rescinding tasks.
When returns TRUE, handleRescindedAlloc is called. Returns
TRUE when downstream, a FailedAllocation is made.
WARNING WARNING WARNING: returning TRUE can easily lead
to an infinite loop consisting of try again-fail-try again, etc.
Subclasses should return FALSE even when the allocation
fails if they can't do anything differently the second time.
Returning FALSE makes the failure get reported to its
superior.
If in making an allocation, a preference
threshold is exceeded, the returned plan element will be
a FailedAllocation (see UTILAllocate.makeAllocation ()).
TOPS does not create any allocations with
AllocationResults w/ isSuccess = false, but COUGAAR will roll
up the results of a workflow, and create an AllocResult
w/ isSuccess = False if it contains a FailedAllocation.
Called by UTILAllocationCallback.reactToChangedAlloc.
Implemented for UTILAllocationListener
Public version of publishRemove
Called by UTILAllocationCallback.reactToChangedAlloc.
FIXIT! -- if you remove the try-catch block, sometimes will see
reset claim exceptions.
The idea is to add subscriptions (via the filterCallback), and when
they change, to have the callback react to the change, and tell
the listener (many times the plugin) what to do.
Override and call super to add new filters, or override
createXXXCallback to change callback behaviour.
By default adds asset callback and allocation callback after
creating them.