Interface CollectionRefreshQueueDelegate
PersistedCollectionHolder types (currently only
package types). For supported persisted collection holder types, the out-of-the-box clients will call one of the
isEnabledForBackgroundRefresh methods to determine if holders of that type should be refreshed in the background
or foreground. A site may define their own implementation of these methods for selective backgrounding of collection holders
based on type or specifically for the instance.
On startup, method createQueues will be called to create the processing queues to be utilized for processing
background refresh tasks for persisted collection holders. A site may define their own implementation of this method for more
sophisticated queue handling.
When a refresh is requested to be done in the background (whether by a user or programmatically by calling a background-specific
refresh method), method getQueueName will be called to request the preferred queue to place the refresh task on
for the collection holder instance. A site may define their own implementation of this method for more sophisticated queue
handling.
Method isExecutingOnQueue will called to determine if a persisted collection holder already has a pending refresh
on one of the refresh queues.
Supported API: true Extendable: false
-
Method Summary
Modifier and TypeMethodDescriptionvoidCreates the queues which will process background refreshes.getQueueName(ObjectReference refPersistedCollectionHolder) For the passed in reference to aPersistedCollectionHolderinstance, this method returns the name of the preferred queue to assign the refresh task to.booleanisEnabledForBackgroundRefresh(TypeIdentifier typeIdentifier, OrgContainer orgContainer) For the passed in type identifier and organization container, this method returns whether the refresh should be done in the background via a queue or in the foreground.booleanisEnabledForBackgroundRefresh(ObjectReference refPersistedCollectionHolder) For the passed in reference to aPersistedCollectionHolder, this method returns whether a refresh for it should be performed in the background via a queue or in the foreground.booleanisExecutingOnQueue(ObjectReference refPersistedCollectionHolder) For the passed in reference to aPersistedCollectionHolderinstance, this method returns whether that holder instance is already queued up for a pending refresh in background.
-
Method Details
-
createQueues
Creates the queues which will process background refreshes. This will be called on system startup when the system is configured to support background refreshes of persisted collections.Supported API: true
- Throws:
WTException
-
isEnabledForBackgroundRefresh
For the passed in type identifier and organization container, this method returns whether the refresh should be done in the background via a queue or in the foreground. The out-of-the-box implementation will return true for all non-replication package types when the system is configured for background refresh. Managed collections will return false, meaning refreshes will continue to be performed in foreground.Supported API: true
- Parameters:
typeIdentifier- type identifier ofPersistedCollectionHolderto inspect for background configurationorgContainer- organization container context- Returns:
- true if refresh should be performed in background; false if it should be performed in foreground
- See Also:
-
isEnabledForBackgroundRefresh
For the passed in reference to aPersistedCollectionHolder, this method returns whether a refresh for it should be performed in the background via a queue or in the foreground. The out-of-the-box implementation will return true for all non-replication package types when the system is configured for background refresh. Managed collections will return false, meaning refreshes will continue to be performed in the foreground.Supported API: true
- Parameters:
refPersistedCollectionHolder- reference to aPersistedCollectionHolderinstance- Returns:
- true if refresh should be performed in background; false if it should be performed in foreground
- See Also:
-
getQueueName
For the passed in reference to aPersistedCollectionHolderinstance, this method returns the name of the preferred queue to assign the refresh task to. The out-of-the-box implementation will apply a simple algorithm for determining which queue should be used. Roughly, the algorithm will choose a queue in the following manner:- If the holder is already on a queue, it will be placed on that same queue
- If the holder is not already on a queue, it will be placed on the queue with the fewest entries
Supported API: true
- Parameters:
refPersistedCollectionHolder- reference toPersistedCollectionHolder- Returns:
- name of queue which would be preferred for assigning background task to
- Throws:
WTException
-
isExecutingOnQueue
For the passed in reference to aPersistedCollectionHolderinstance, this method returns whether that holder instance is already queued up for a pending refresh in background. This method will return true if the a background refresh task exists and the associated queue entry is at a status ofREADY,SUSPENDED, orEXECUTING.Supported API: true
- Parameters:
refPersistedCollectionHolder- reference to aPersistedCollectionHolderinstance to determine if already refreshing in background- Returns:
- true if collection holder has a pending refresh already in queue
- Throws:
WTException
-