public class BaseCacheConfiguration<K,V> extends java.lang.Object implements CacheConfiguration<K,V>
CacheConfiguration
.Constructor and Description |
---|
BaseCacheConfiguration(java.lang.Class<K> keyType,
java.lang.Class<V> valueType,
EvictionAdvisor<? super K,? super V> evictionAdvisor,
java.lang.ClassLoader classLoader,
ExpiryPolicy<? super K,? super V> expiry,
ResourcePools resourcePools,
ServiceConfiguration<?,?>... serviceConfigurations)
Creates a new
BaseCacheConfiguration from the given parameters. |
Modifier and Type | Method and Description |
---|---|
CacheConfigurationBuilder<K,V> |
derive()
Create a builder seeded with this configuration.
|
java.lang.ClassLoader |
getClassLoader()
The
ClassLoader for the Cache . |
EvictionAdvisor<? super K,? super V> |
getEvictionAdvisor()
The
EvictionAdvisor predicate function. |
Expiry<? super K,? super V> |
getExpiry()
|
ExpiryPolicy<? super K,? super V> |
getExpiryPolicy()
The
ExpiryPolicy rules for the Cache . |
java.lang.Class<K> |
getKeyType()
The key type for the
Cache . |
ResourcePools |
getResourcePools()
The
ResourcePools for the Cache . |
java.util.Collection<ServiceConfiguration<?,?>> |
getServiceConfigurations()
The service configurations defined for the
Cache . |
java.lang.Class<V> |
getValueType()
The value type for the
Cache . |
public BaseCacheConfiguration(java.lang.Class<K> keyType, java.lang.Class<V> valueType, EvictionAdvisor<? super K,? super V> evictionAdvisor, java.lang.ClassLoader classLoader, ExpiryPolicy<? super K,? super V> expiry, ResourcePools resourcePools, ServiceConfiguration<?,?>... serviceConfigurations)
BaseCacheConfiguration
from the given parameters.keyType
- the key typevalueType
- the value typeevictionAdvisor
- the eviction advisorclassLoader
- the class loaderexpiry
- the expiry policyresourcePools
- the resource poolsserviceConfigurations
- the service configurationspublic java.util.Collection<ServiceConfiguration<?,?>> getServiceConfigurations()
Cache
.
Implementations must return an unmodifiable collection.
getServiceConfigurations
in interface CacheConfiguration<K,V>
public java.lang.Class<K> getKeyType()
Cache
.
The key type must not be null
.
getKeyType
in interface CacheConfiguration<K,V>
null
classpublic java.lang.Class<V> getValueType()
Cache
.
The value type must not be null
.
getValueType
in interface CacheConfiguration<K,V>
null
classpublic EvictionAdvisor<? super K,? super V> getEvictionAdvisor()
EvictionAdvisor
predicate function.
Entries which pass this predicate may be ignored by the eviction process. This is only a hint.
getEvictionAdvisor
in interface CacheConfiguration<K,V>
public java.lang.ClassLoader getClassLoader()
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.
getClassLoader
in interface CacheConfiguration<K,V>
ClassLoader
public Expiry<? super K,? super V> getExpiry()
getExpiry
in interface CacheConfiguration<K,V>
Expiry
public ExpiryPolicy<? super K,? super V> getExpiryPolicy()
getExpiryPolicy
in interface CacheConfiguration<K,V>
ExpiryPolicy
public ResourcePools getResourcePools()
getResourcePools
in interface CacheConfiguration<K,V>
ResourcePools
public CacheConfigurationBuilder<K,V> derive()
CacheConfiguration
The default implementation throws UnsupportedOperationException
to indicate that configuration derivation
is not supported.
derive
in interface CacheConfiguration<K,V>
FluentConfigurationBuilder