org.ehcache
Class RuntimeConfiguration<K,V>

java.lang.Object
  extended by org.ehcache.RuntimeConfiguration<K,V>
All Implemented Interfaces:
CacheConfiguration<K,V>, CacheRuntimeConfiguration<K,V>, InternalRuntimeConfiguration

public class RuntimeConfiguration<K,V>
extends java.lang.Object
implements CacheRuntimeConfiguration<K,V>, InternalRuntimeConfiguration


Constructor Summary
RuntimeConfiguration(CacheConfiguration<K,V> config, CacheEventNotificationService<K,V> eventNotifier)
           
 
Method Summary
 boolean addCacheConfigurationListener(java.util.List<CacheConfigurationChangeListener> listeners)
          adds listeners for cache configuration changes
 void deregisterCacheEventListener(CacheEventListener<? super K,? super V> listener)
          Allows for deregistering of a previously registered CacheEventListener instance
 java.lang.ClassLoader getClassLoader()
          The ClassLoader for this cache.
 EvictionPrioritizer<? super K,? super V> getEvictionPrioritizer()
          The EvictionPrioritizer comparator.
 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.
 void registerCacheEventListener(CacheEventListener<? super K,? super V> listener, EventOrdering ordering, EventFiring firing, java.util.Set<EventType> forEventTypes)
          Allows for registering CacheEventListener on the cache
 boolean removeCacheConfigurationListener(CacheConfigurationChangeListener listener)
          removes cache configuration listeners
 void updateResourcePools(ResourcePools pools)
          updates ResourcePools
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RuntimeConfiguration

public RuntimeConfiguration(CacheConfiguration<K,V> config,
                            CacheEventNotificationService<K,V> eventNotifier)
Method Detail

updateResourcePools

public void updateResourcePools(ResourcePools pools)
Description copied from interface: CacheRuntimeConfiguration
updates ResourcePools

Specified by:
updateResourcePools in interface CacheRuntimeConfiguration<K,V>
Parameters:
pools - the ResourcePools that need to be updated

getServiceConfigurations

public java.util.Collection<ServiceConfiguration<?>> getServiceConfigurations()
Description copied from interface: CacheConfiguration
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()
Description copied from interface: CacheConfiguration
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()
Description copied from interface: CacheConfiguration
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()
Description copied from interface: CacheConfiguration
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

getEvictionPrioritizer

public EvictionPrioritizer<? super K,? super V> getEvictionPrioritizer()
Description copied from interface: CacheConfiguration
The EvictionPrioritizer comparator.

This comparator function determines the order in which entries are considered for eviction.

Specified by:
getEvictionPrioritizer in interface CacheConfiguration<K,V>
Returns:
the eviction prioritizer

getClassLoader

public java.lang.ClassLoader getClassLoader()
Description copied from interface: CacheConfiguration
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()
Description copied from interface: CacheConfiguration
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()
Description copied from interface: CacheConfiguration
Get the resource pools the Cache can make use of.

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

addCacheConfigurationListener

public boolean addCacheConfigurationListener(java.util.List<CacheConfigurationChangeListener> listeners)
Description copied from interface: InternalRuntimeConfiguration
adds listeners for cache configuration changes

Specified by:
addCacheConfigurationListener in interface InternalRuntimeConfiguration

removeCacheConfigurationListener

public boolean removeCacheConfigurationListener(CacheConfigurationChangeListener listener)
Description copied from interface: InternalRuntimeConfiguration
removes cache configuration listeners

Specified by:
removeCacheConfigurationListener in interface InternalRuntimeConfiguration

deregisterCacheEventListener

public void deregisterCacheEventListener(CacheEventListener<? super K,? super V> listener)
Description copied from interface: CacheRuntimeConfiguration
Allows for deregistering of a previously registered CacheEventListener instance

Specified by:
deregisterCacheEventListener in interface CacheRuntimeConfiguration<K,V>
Parameters:
listener - the listener to deregister

registerCacheEventListener

public void registerCacheEventListener(CacheEventListener<? super K,? super V> listener,
                                       EventOrdering ordering,
                                       EventFiring firing,
                                       java.util.Set<EventType> forEventTypes)
Description copied from interface: CacheRuntimeConfiguration
Allows for registering CacheEventListener on the cache

Specified by:
registerCacheEventListener in interface CacheRuntimeConfiguration<K,V>
Parameters:
listener - the listener instance to register
ordering - the EventOrdering to invoke this listener
firing - the EventFiring to invoke this listener
forEventTypes - the EventType to notify this listener of