K
- the type of the key to be used for cachingT
- the type of the objects that this provider providespublic interface CacheElementProvider<K extends CacheKey,T extends Serializable>
load(CacheKey)
method is called and the returned element will be cached.Modifier and Type | Field and Description |
---|---|
static int |
ETERNAL_TIME_TO_LIVE
Constant representing eternal caching.
|
Modifier and Type | Method and Description |
---|---|
String |
getContentType()
Returns a unique string naming the content type of the elements provided by this provider
(e.g.
|
int |
getTimeToLive()
Returns the time in seconds describing how long a provided element will be cached without
expiring (when it is not replaced manually).
|
T |
load(K key)
Provides an element identified by the key for caching.
|
static final int ETERNAL_TIME_TO_LIVE
String getContentType()
int getTimeToLive()
ETERNAL_TIME_TO_LIVE
when the
element should never expire.T load(K key) throws CacheElementProviderException
key
- the key to identify the requested elementCacheElementProviderException
- in case the loading failed and nothing should or can be cachedCopyright © 2019 Communote team. All rights reserved.