Class AbstractObjectCacheManager<T>

    • Constructor Detail

      • AbstractObjectCacheManager

        public AbstractObjectCacheManager()
    • Method Detail

      • 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
      • 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.
      • 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 java.lang.String getDebugKey​(ObjectKey<T> objectKey)