Class AbstractObjectCacheManager<T>

java.lang.Object
de.hybris.platform.cache2.AbstractObjectCacheManager<T>
All Implemented Interfaces:
ObjectCacheManager<T>
Direct Known Subclasses:
Cache2Test.TestObjectCacheManager, ObjectCacheManagerImpl

public abstract class AbstractObjectCacheManager<T> extends Object implements ObjectCacheManager<T>
  • Constructor Details

    • AbstractObjectCacheManager

      public AbstractObjectCacheManager()
  • Method Details

    • setObjectAutoCreation

      public void setObjectAutoCreation(boolean autocreate)
    • setExpirationCheck

      public void setExpirationCheck(boolean expirationCheck)
    • getCache

      public ObjectCache<T> getCache()
      Description copied from interface: ObjectCacheManager
      Returns the underlaying cache. The cache does not have any automated management and provides only low-level access.
      Specified by:
      getCache in interface ObjectCacheManager<T>
      Returns:
      ObjectCache the cache implementation
    • setCache

      public void setCache(ObjectCache<T> objectCache)
      Description copied from interface: ObjectCacheManager
      Set the underlaying cache implementation
      Specified by:
      setCache in interface ObjectCacheManager<T>
      Parameters:
      objectCache - the cache implementation
    • fetch

      public T fetch(ObjectKey<T> objectKey)
      Description copied from interface: ObjectCacheManager
      Looks for the object under the given ObjectKey. There are three possibilities:
      When the object is found, it will be returned.
      When no object is found, the ObjectCreator creates 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, the ObjectCreator creates a new object which is put on the cache and returned.
      Specified by:
      fetch in interface ObjectCacheManager<T>
      Parameters:
      objectKey - ObjectKey
      Returns:
      cached object.
    • invalidate

      public void invalidate(ObjectKey<T> objectKey)
      Description copied from interface: ObjectCacheManager
      Invalidates the object under the given (@link ObjectKey}
      Specified by:
      invalidate in interface ObjectCacheManager<T>
      Parameters:
      objectKey - the object key
    • handleExpiration

      protected void handleExpiration(ObjectKey<T> objectKey)
      Default implementation simply removes the expired object.
      Parameters:
      objectKey -
    • handleInvalidation

      protected void handleInvalidation(ObjectKey<T> objectKey)
      Default implementation simply removed the invalidated object.
      Parameters:
      objectKey -
    • handleRequest

      protected T handleRequest(ObjectKey<T> objectKey)
      Default implementation simply requests the cache with the given key.
      Parameters:
      objectKey -
    • handleCreation

      protected T handleCreation(ObjectKey<T> objectKey)
      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

      protected String getDebugKey(ObjectKey<T> objectKey)