Package de.hybris.platform.cache2
Class AbstractObjectCacheManager<T>
java.lang.Object
de.hybris.platform.cache2.AbstractObjectCacheManager<T>
- All Implemented Interfaces:
ObjectCacheManager<T>
- Direct Known Subclasses:
Cache2Test.TestObjectCacheManager,ObjectCacheManagerImpl
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionLooks for the object under the givenObjectKey.getCache()Returns the underlaying cache.protected StringgetDebugKey(ObjectKey<T> objectKey) protected ThandleCreation(ObjectKey<T> objectKey) Default implementation of how objects should be created.protected voidhandleExpiration(ObjectKey<T> objectKey) Default implementation simply removes the expired object.protected voidhandleInvalidation(ObjectKey<T> objectKey) Default implementation simply removed the invalidated object.protected ThandleRequest(ObjectKey<T> objectKey) Default implementation simply requests the cache with the given key.voidinvalidate(ObjectKey<T> objectKey) Invalidates the object under the given (@link ObjectKey}voidsetCache(ObjectCache<T> objectCache) Set the underlaying cache implementationvoidsetExpirationCheck(boolean expirationCheck) voidsetObjectAutoCreation(boolean autocreate)
-
Constructor Details
-
AbstractObjectCacheManager
public AbstractObjectCacheManager()
-
-
Method Details
-
setObjectAutoCreation
public void setObjectAutoCreation(boolean autocreate) -
setExpirationCheck
public void setExpirationCheck(boolean expirationCheck) -
getCache
Description copied from interface:ObjectCacheManagerReturns the underlaying cache. The cache does not have any automated management and provides only low-level access.- Specified by:
getCachein interfaceObjectCacheManager<T>- Returns:
- ObjectCache the cache implementation
-
setCache
Description copied from interface:ObjectCacheManagerSet the underlaying cache implementation- Specified by:
setCachein interfaceObjectCacheManager<T>- Parameters:
objectCache- the cache implementation
-
fetch
Description copied from interface:ObjectCacheManagerLooks for the object under the givenObjectKey. There are three possibilities:
When the object is found, it will be returned.
When no object is found, theObjectCreatorcreates a new one. The newly created object will be put on the cache and returned.
When the signature of the objectKey is outdated, the appropriate cached object (when available) will be removed. The keys signature will be renewed, theObjectCreatorcreates a new object which is put on the cache and returned.- Specified by:
fetchin interfaceObjectCacheManager<T>- Parameters:
objectKey- ObjectKey- Returns:
- cached object.
-
invalidate
Description copied from interface:ObjectCacheManagerInvalidates the object under the given (@link ObjectKey}- Specified by:
invalidatein interfaceObjectCacheManager<T>- Parameters:
objectKey- the object key
-
handleExpiration
Default implementation simply removes the expired object.- Parameters:
objectKey-
-
handleInvalidation
Default implementation simply removed the invalidated object.- Parameters:
objectKey-
-
handleRequest
Default implementation simply requests the cache with the given key.- Parameters:
objectKey-
-
handleCreation
Default implementation of how objects should be created. This implementation calls the ObjectCreator (objectkey.getObjectCreator()) to create the object and puts this object into the cache.- Parameters:
objectKey- the objectkey- Returns:
- the created object which has been put into the cache
-
getDebugKey
-