T
- the cache type.public abstract class SingleOrBulkLoadCacheDataProvider<T> extends Object implements ICacheMultiDataProvider<T>
ICacheMultiDataProvider
that eases the use of single and bulk loads, based on a given condition.
Also, provides synchronization, to avoid multiple bulk loads at the same time.ICacheMultiDataProvider.IRequest
Modifier and Type | Field and Description |
---|---|
protected Integer |
lastBulkloadReadsize
Stores the last bulk load size.
|
Constructor and Description |
---|
SingleOrBulkLoadCacheDataProvider() |
Modifier and Type | Method and Description |
---|---|
protected abstract Collection<CacheItem<T>> |
doBulkLoad(ICacheMultiDataProvider.IRequest request)
Performs a bulk load.
|
protected abstract CacheItem<T> |
doSingleLoad(ICacheMultiDataProvider.IRequest request)
Performs a single load.
|
Collection<CacheItem<T>> |
loadData(ICacheMultiDataProvider.IRequest request)
Returns the data to be loaded into the cache.
|
protected boolean |
shouldBulkLoad(ICacheMultiDataProvider.IRequest request)
Returns whether the
bulk load should be performed. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDefaultValue
protected Integer lastBulkloadReadsize
public Collection<CacheItem<T>> loadData(ICacheMultiDataProvider.IRequest request) throws PortalException
ICacheMultiDataProvider
loadData
in interface ICacheMultiDataProvider<T>
request
- a request object containing information about the requested data.ICacheMultiDataProvider.getDefaultValue()
.PortalException
protected abstract CacheItem<T> doSingleLoad(ICacheMultiDataProvider.IRequest request) throws PortalException
request
- the cache request.PortalException
protected abstract Collection<CacheItem<T>> doBulkLoad(ICacheMultiDataProvider.IRequest request) throws PortalException
request
- the cache request.PortalException
protected boolean shouldBulkLoad(ICacheMultiDataProvider.IRequest request)
bulk load
should be performed.
If false
, a single load
will be performed, instead.request
- the request.bulk load
should be performed.LumisXP 12.3.0.200408 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.