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 aCache.Implementations are expected to be read-only.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default FluentCacheConfigurationBuilder<K,V,?>derive()Create a builder seeded with this configuration.java.lang.ClassLoadergetClassLoader()TheClassLoaderfor theCache.EvictionAdvisor<? super K,? super V>getEvictionAdvisor()TheEvictionAdvisorpredicate function.Expiry<? super K,? super V>getExpiry()Deprecated.ExpiryPolicy<? super K,? super V>getExpiryPolicy()TheExpiryPolicyrules for theCache.java.lang.Class<K>getKeyType()The key type for theCache.ResourcePoolsgetResourcePools()TheResourcePoolsfor theCache.java.util.Collection<ServiceConfiguration<?,?>>getServiceConfigurations()The service configurations defined for theCache.java.lang.Class<V>getValueType()The value type for theCache.
-
-
-
Method Detail
-
getServiceConfigurations
java.util.Collection<ServiceConfiguration<?,?>> getServiceConfigurations()
The service configurations defined for theCache.Implementations must return an unmodifiable collection.
- Returns:
- service configurations
-
getKeyType
java.lang.Class<K> getKeyType()
The key type for theCache.The key type must not be
null.- Returns:
- a non
nullclass
-
getValueType
java.lang.Class<V> 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
java.lang.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
-
getExpiryPolicy
ExpiryPolicy<? super K,? super V> getExpiryPolicy()
- Returns:
- the
ExpiryPolicy
-
getResourcePools
ResourcePools getResourcePools()
- Returns:
- the
ResourcePools
-
derive
default FluentCacheConfigurationBuilder<K,V,?> derive() throws java.lang.UnsupportedOperationException
Create a builder seeded with this configuration.The default implementation throws
UnsupportedOperationExceptionto indicate that configuration derivation is not supported.- Returns:
- a configuration builder
- Throws:
java.lang.UnsupportedOperationException- if configuration derivation is not supported- See Also:
FluentConfigurationBuilder
-
-