Class BaseCache<K,​V>

    • Constructor Detail

      • BaseCache

        public BaseCache()
    • Method Detail

      • getExecutor

        public abstract Executor getExecutor()
      • createFireAndForgetAction

        protected abstract <R> EntryAction<K,​V,​R> createFireAndForgetAction​(Entry<K,​V> e,
                                                                                        Semantic<K,​V,​R> op)
      • iterator

        protected abstract Iterator<org.cache2k.CacheEntry<K,​V>> iterator()
      • keys

        public Set<K> keys()
        Key iteration on top of normal iterator.
        Specified by:
        keys in interface org.cache2k.Cache<K,​V>
      • entries

        public Set<org.cache2k.CacheEntry<K,​V>> entries()
        Specified by:
        entries in interface org.cache2k.Cache<K,​V>
      • removeAll

        public void removeAll()
        Specified by:
        removeAll in interface org.cache2k.Cache<K,​V>
      • removeAll

        public void removeAll​(Iterable<? extends K> keys)
        Specified by:
        removeAll in interface org.cache2k.Cache<K,​V>
      • requestInterface

        public <X> X requestInterface​(Class<X> type)
        Specified by:
        requestInterface in interface org.cache2k.Cache<K,​V>
      • asMap

        public ConcurrentMap<K,​V> asMap()
        Specified by:
        asMap in interface org.cache2k.Cache<K,​V>
      • invoke

        public <R> R invoke​(K key,
                            org.cache2k.processor.EntryProcessor<K,​V,​R> processor)
        Simply the EntryAction based code to provide the entry processor. If we code it directly this might be a little bit more efficient, but it gives quite a code bloat which has lots of corner cases for loader and exception handling.
        Specified by:
        invoke in interface org.cache2k.Cache<K,​V>
      • invokeAll

        public <R> Map<K,​org.cache2k.processor.EntryProcessingResult<R>> invokeAll​(Iterable<? extends K> keys,
                                                                                         org.cache2k.processor.EntryProcessor<K,​V,​R> entryProcessor)
        Specified by:
        invokeAll in interface org.cache2k.Cache<K,​V>
      • expireAt

        public void expireAt​(K key,
                             long time)
        Specified by:
        expireAt in interface org.cache2k.Cache<K,​V>
      • execute

        protected <R> R execute​(K key,
                                Semantic<K,​V,​R> op)
      • execute

        protected <R> R execute​(K key,
                                Entry<K,​V> e,
                                Semantic<K,​V,​R> op)
      • toString

        public String toString()
        Return status information. The status collection is time-consuming, so this is an expensive operation.
        Specified by:
        toString in interface org.cache2k.Cache<K,​V>
        Overrides:
        toString in class Object