org.ehcache.core.config
Class BaseCacheConfiguration<K,V>

java.lang.Object
  extended by org.ehcache.core.config.BaseCacheConfiguration<K,V>
All Implemented Interfaces:
CacheConfiguration<K,V>

public class BaseCacheConfiguration<K,V>
extends java.lang.Object
implements CacheConfiguration<K,V>

Base implementation of CacheConfiguration.


Constructor Summary
BaseCacheConfiguration(java.lang.Class<? super K> keyType, java.lang.Class<? super V> valueType, EvictionVeto<? super K,? super V> evictionVeto, java.lang.ClassLoader classLoader, Expiry<? super K,? super V> expiry, ResourcePools resourcePools, ServiceConfiguration<?>... serviceConfigurations)
          Creates a new BaseCacheConfiguration from the given parameters.
 
Method Summary
 java.lang.ClassLoader getClassLoader()
          The ClassLoader for this cache.
 EvictionVeto<? super K,? super V> getEvictionVeto()
          The EvictionVeto predicate function.
 Expiry<? super K,? super V> getExpiry()
          Get the expiration policy instance for the Cache.
 java.lang.Class<K> getKeyType()
          The type of the key for the cache.
 ResourcePools getResourcePools()
          Get the resource pools the Cache can make use of.
 java.util.Collection<ServiceConfiguration<?>> getServiceConfigurations()
          Not sure whether this should be exposed on this interface really.
 java.lang.Class<V> getValueType()
          The type of the value held in the cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseCacheConfiguration

public BaseCacheConfiguration(java.lang.Class<? super K> keyType,
                              java.lang.Class<? super V> valueType,
                              EvictionVeto<? super K,? super V> evictionVeto,
                              java.lang.ClassLoader classLoader,
                              Expiry<? super K,? super V> expiry,
                              ResourcePools resourcePools,
                              ServiceConfiguration<?>... serviceConfigurations)
Creates a new BaseCacheConfiguration from the given parameters.

Parameters:
keyType - the key type
valueType - the value type
evictionVeto - the eviction veto
classLoader - the class loader
expiry - the expiry policy
resourcePools - the resource pools
serviceConfigurations - the service configurations
Method Detail

getServiceConfigurations

public java.util.Collection<ServiceConfiguration<?>> getServiceConfigurations()
Not sure whether this should be exposed on this interface really.

Specified by:
getServiceConfigurations in interface CacheConfiguration<K,V>
Returns:
unmodifiable collection of service configuration related to the cache

getKeyType

public java.lang.Class<K> getKeyType()
The type of the key for the cache.

Specified by:
getKeyType in interface CacheConfiguration<K,V>
Returns:
a non null value, where Object.class is the widest type

getValueType

public java.lang.Class<V> getValueType()
The type of the value held in the cache.

Specified by:
getValueType in interface CacheConfiguration<K,V>
Returns:
a non null value, where Object.class is the widest type

getEvictionVeto

public EvictionVeto<? super K,? super V> getEvictionVeto()
The EvictionVeto predicate function.

Entries which pass this predicate must be ignored by the eviction process.

Specified by:
getEvictionVeto in interface CacheConfiguration<K,V>
Returns:
the eviction veto predicate

getClassLoader

public java.lang.ClassLoader getClassLoader()
The ClassLoader for this cache. This ClassLoader will be used to instantiate cache level services as well as deserializing cache entries when required.

Specified by:
getClassLoader in interface CacheConfiguration<K,V>
Returns:
the cache ClassLoader

getExpiry

public Expiry<? super K,? super V> getExpiry()
Get the expiration policy instance for the Cache.

Specified by:
getExpiry in interface CacheConfiguration<K,V>
Returns:
the Expiry to configure

getResourcePools

public ResourcePools getResourcePools()
Get the resource pools the Cache can make use of.

Specified by:
getResourcePools in interface CacheConfiguration<K,V>
Returns:
the ResourcePools