Interface CacheConfiguration<K,​V>

  • Type Parameters:
    K - the key type for the cache
    V - the value type for the cache
    All Known Subinterfaces:
    CacheRuntimeConfiguration<K,​V>

    public interface CacheConfiguration<K,​V>
    Represents the minimal configuration for a Cache.

    Implementations are expected to be read-only.

    • Method Detail

      • getServiceConfigurations

        java.util.Collection<ServiceConfiguration<?,​?>> getServiceConfigurations()
        The service configurations defined for the Cache.

        Implementations must return an unmodifiable collection.

        Returns:
        service configurations
      • getKeyType

        java.lang.Class<K> getKeyType()
        The key type for the Cache.

        The key type must not be null.

        Returns:
        a non null class
      • getValueType

        java.lang.Class<V> getValueType()
        The value type for the Cache.

        The value type must not be null.

        Returns:
        a non null class
      • getEvictionAdvisor

        EvictionAdvisor<? super K,​? super V> getEvictionAdvisor()
        The EvictionAdvisor predicate function.

        Entries which pass this predicate may be ignored by the eviction process. This is only a hint.

        Returns:
        the eviction advisor predicate
      • getClassLoader

        java.lang.ClassLoader getClassLoader()
        The ClassLoader for the Cache.

        This ClassLoader will be used to instantiate cache level services and for deserializing cache entries when required.

        The ClassLoader must not be null.

        Returns:
        the cache ClassLoader
      • getExpiry

        @Deprecated
        Expiry<? super K,​? super V> getExpiry()
        Deprecated.
        The Expiry rules for the Cache.

        The Expiry cannot be null.

        Returns:
        the Expiry
      • getExpiryPolicy

        ExpiryPolicy<? super K,​? super V> getExpiryPolicy()
        The ExpiryPolicy rules for the Cache.

        The ExpiryPolicy cannot be null.

        Returns:
        the ExpiryPolicy
      • derive

        default FluentCacheConfigurationBuilder<K,​V,​?> derive()
                                                                   throws java.lang.UnsupportedOperationException
        Create a builder seeded with this configuration.

        The default implementation throws UnsupportedOperationException to indicate that configuration derivation is not supported.

        Returns:
        a configuration builder
        Throws:
        java.lang.UnsupportedOperationException - if configuration derivation is not supported
        See Also:
        FluentConfigurationBuilder