public abstract class AbstractObjectCacheManager<T> extends java.lang.Object implements ObjectCacheManager<T>
| Constructor and Description |
|---|
AbstractObjectCacheManager() |
| Modifier and Type | Method and Description |
|---|---|
T |
fetch(ObjectKey<T> objectKey)
Looks for the object under the given
ObjectKey. |
ObjectCache<T> |
getCache()
Returns the underlaying cache.
|
protected java.lang.String |
getDebugKey(ObjectKey<T> objectKey) |
protected T |
handleCreation(ObjectKey<T> objectKey)
Default implementation of how objects should be created.
|
protected void |
handleExpiration(ObjectKey<T> objectKey)
Default implementation simply removes the expired object.
|
protected void |
handleInvalidation(ObjectKey<T> objectKey)
Default implementation simply removed the invalidated object.
|
protected T |
handleRequest(ObjectKey<T> objectKey)
Default implementation simply requests the cache with the given key.
|
void |
invalidate(ObjectKey<T> objectKey)
Invalidates the object under the given (@link ObjectKey}
|
void |
setCache(ObjectCache<T> objectCache)
Set the underlaying cache implementation
|
void |
setExpirationCheck(boolean expirationCheck) |
void |
setObjectAutoCreation(boolean autocreate) |
public void setObjectAutoCreation(boolean autocreate)
public void setExpirationCheck(boolean expirationCheck)
public ObjectCache<T> getCache()
ObjectCacheManagergetCache in interface ObjectCacheManager<T>public void setCache(ObjectCache<T> objectCache)
ObjectCacheManagersetCache in interface ObjectCacheManager<T>objectCache - the cache implementationpublic T fetch(ObjectKey<T> objectKey)
ObjectCacheManagerObjectKey. There are three possibilities: ObjectCreator creates a new one. The newly created object will be put on the
cache and returned. ObjectCreator creates a new object which is put on the cache and
returned.fetch in interface ObjectCacheManager<T>objectKey - ObjectKeypublic void invalidate(ObjectKey<T> objectKey)
ObjectCacheManagerinvalidate in interface ObjectCacheManager<T>objectKey - the object keyprotected void handleExpiration(ObjectKey<T> objectKey)
objectKey - protected void handleInvalidation(ObjectKey<T> objectKey)
objectKey - protected T handleRequest(ObjectKey<T> objectKey)
objectKey - protected T handleCreation(ObjectKey<T> objectKey)
objectKey - the objectkeyCopyright © 2018 SAP SE. All Rights Reserved.