Package org.ehcache.config
Interface CacheConfiguration<K,V>
- Type Parameters:
K- the key type for the cacheV- 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 Summary
Modifier and TypeMethodDescriptiondefault FluentCacheConfigurationBuilder<K,V, ?> derive()Create a builder seeded with this configuration.TheClassLoaderfor theCache.EvictionAdvisor<? super K,? super V> TheEvictionAdvisorpredicate function.Deprecated.ExpiryPolicy<? super K,? super V> TheExpiryPolicyrules for theCache.The key type for theCache.TheResourcePoolsfor theCache.The service configurations defined for theCache.The value type for theCache.
-
Method Details
-
getServiceConfigurations
Collection<ServiceConfiguration<?,?>> getServiceConfigurations()The service configurations defined for theCache.Implementations must return an unmodifiable collection.
- Returns:
- service configurations
-
getKeyType
The key type for theCache.The key type must not be
null.- Returns:
- a non
nullclass
-
getValueType
The value type for theCache.The value type must not be
null.- Returns:
- a non
nullclass
-
getEvictionAdvisor
EvictionAdvisor<? super K,? super V> getEvictionAdvisor()TheEvictionAdvisorpredicate function.Entries which pass this predicate may be ignored by the eviction process. This is only a hint.
- Returns:
- the eviction advisor predicate
-
getClassLoader
ClassLoader getClassLoader()TheClassLoaderfor theCache.This
ClassLoaderwill be used to instantiate cache level services and for deserializing cache entries when required.The
ClassLoadermust not be null.- Returns:
- the cache
ClassLoader
-
getExpiry
Deprecated.- Returns:
- the
Expiry
-
getExpiryPolicy
ExpiryPolicy<? super K,? super V> getExpiryPolicy()- Returns:
- the
ExpiryPolicy
-
getResourcePools
ResourcePools getResourcePools()- Returns:
- the
ResourcePools
-
derive
Create a builder seeded with this configuration.The default implementation throws
UnsupportedOperationExceptionto indicate that configuration derivation is not supported.- Returns:
- a configuration builder
- Throws:
UnsupportedOperationException- if configuration derivation is not supported- See Also:
-
getExpiryPolicy()