Class CacheHandlerImpl

    • Constructor Detail

      • CacheHandlerImpl

        public CacheHandlerImpl()
    • Method Detail

      • destroy

        @PreDestroy
        public void destroy()
      • getLocalCache

        public com.google.common.cache.Cache<Object,​Object> getLocalCache()
        Description copied from interface: CacheHandler
        The local cache is a general-purpose Guava cache that can be used to store data in a cluster will never be distributed
        Specified by:
        getLocalCache in interface CacheHandler
      • initialize

        @PostConstruct
        public void initialize()
      • scheduleClear

        public <K extends Serializable,​V extends Serializable> void scheduleClear​(CacheType<K,​V> type)
        Description copied from interface: CacheHandler
        Schedules a cache clear to be executed after the current transaction has been committed (important to prevent the cache from being reloaded by another thread before the current transaction is committed, populating the cache with a stale value)
        Specified by:
        scheduleClear in interface CacheHandler
      • scheduleEvict

        public <K extends Serializable,​V extends Serializable> void scheduleEvict​(CacheType<K,​V> type,
                                                                                        K key)
        Description copied from interface: CacheHandler
        Schedules the eviction of an specific cache key after the current transaction has been committed (important to prevent the cache from being reloaded by another thread before the current transaction is committed, populating the cache with a stale value)
        Specified by:
        scheduleEvict in interface CacheHandler
      • scheduleEvict

        public <K extends Serializable,​V extends Serializable> void scheduleEvict​(CacheType<K,​V> type,
                                                                                        Set<K> keys)
        Description copied from interface: CacheHandler
        Schedules the eviction of the given cache keys after the current transaction has been committed (important to prevent the cache from being reloaded by another thread before the current transaction is committed, populating the cache with a stale value)
        Specified by:
        scheduleEvict in interface CacheHandler
      • schedulePartialEvict

        public <K extends Serializable,​V extends Serializable> void schedulePartialEvict​(CacheType<K,​V> type,
                                                                                               SerializablePredicate<K> predicate)
        Description copied from interface: CacheHandler
        Schedules the eviction of the keys matching the given predicate after the current transaction has been committed (important to prevent the cache from being reloaded by another thread before the current transaction is committed, populating the cache with a stale value)
        Specified by:
        schedulePartialEvict in interface CacheHandler
      • createGuavaCache

        protected <V,​K> com.google.common.cache.Cache<K,​V> createGuavaCache​(String name)