Class CacheModule

    • Constructor Detail

      • CacheModule

        public CacheModule()
    • Method Detail

      • cache

        protected <K,​V> CacheBinding<K,​V> cache​(String name,
                                                            Class<K> keyType,
                                                            Class<V> valType)
        Declare a named in-memory cache.
        Type Parameters:
        K - type of key used to lookup entries.
        V - type of value stored by the cache.
        Returns:
        binding to describe the cache.
      • cache

        protected <K,​V> CacheBinding<K,​V> cache​(String name,
                                                            Class<K> keyType,
                                                            com.google.inject.TypeLiteral<V> valType)
        Declare a named in-memory cache.
        Type Parameters:
        K - type of key used to lookup entries.
        V - type of value stored by the cache.
        Returns:
        binding to describe the cache.
      • cache

        protected <K,​V> CacheBinding<K,​V> cache​(String name,
                                                            com.google.inject.TypeLiteral<K> keyType,
                                                            com.google.inject.TypeLiteral<V> valType)
        Declare a named in-memory cache.
        Type Parameters:
        K - type of key used to lookup entries.
        V - type of value stored by the cache.
        Returns:
        binding to describe the cache.
      • persist

        protected <K,​V> PersistentCacheBinding<K,​V> persist​(String name,
                                                                        Class<K> keyType,
                                                                        Class<V> valType)
        Declare a named in-memory/on-disk cache.
        Type Parameters:
        K - type of key used to lookup entries.
        V - type of value stored by the cache.
        Returns:
        binding to describe the cache.
      • persist

        protected <K,​V> PersistentCacheBinding<K,​V> persist​(String name,
                                                                        Class<K> keyType,
                                                                        com.google.inject.TypeLiteral<V> valType)
        Declare a named in-memory/on-disk cache.
        Type Parameters:
        K - type of key used to lookup entries.
        V - type of value stored by the cache.
        Returns:
        binding to describe the cache.
      • persist

        protected <K,​V> PersistentCacheBinding<K,​V> persist​(String name,
                                                                        com.google.inject.TypeLiteral<K> keyType,
                                                                        com.google.inject.TypeLiteral<V> valType)
        Declare a named in-memory/on-disk cache.
        Type Parameters:
        K - type of key used to lookup entries.
        V - type of value stored by the cache.
        Returns:
        binding to describe the cache.