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.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.Class<K>getKeyType()The key type for theCache.ResourcePoolsgetResourcePools()TheResourcePoolsfor theCache.Collection<ServiceConfiguration<?,?>>getServiceConfigurations()The service configurations defined for theCache.Class<V>getValueType()The value type for theCache.
-
-
-
Method Detail
-
getServiceConfigurations
Collection<ServiceConfiguration<?,?>> getServiceConfigurations()
The service configurations defined for theCache.Implementations must return an unmodifiable collection.
- Returns:
- service configurations
-
getKeyType
Class<K> getKeyType()
The key type for theCache.The key type must not be
null.- Returns:
- a non
nullclass
-
getValueType
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
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 Expiry<? super K,? super V> getExpiry()
Deprecated.- Returns:
- the
Expiry
-
getExpiryPolicy
ExpiryPolicy<? super K,? super V> getExpiryPolicy()
- Returns:
- the
ExpiryPolicy
-
getResourcePools
ResourcePools getResourcePools()
- Returns:
- the
ResourcePools
-
derive
default FluentCacheConfigurationBuilder<K,V,?> derive() throws 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:
UnsupportedOperationException- if configuration derivation is not supported- See Also:
FluentConfigurationBuilder
-
-