org.ehcache.spi.loaderwriter
Interface CacheLoaderWriterProvider

All Superinterfaces:
Service
All Known Implementing Classes:
DefaultCacheLoaderWriterProvider

public interface CacheLoaderWriterProvider
extends Service

A factory Service that will create CacheLoaderWriter instances for a given Cache managed by a CacheManager The CacheManager will request an instance of this Class prior to creating any Cache instances. It'll then use this instance to create CacheLoaderWriter instances for each Cache it manages by invoking the createCacheLoaderWriter(java.lang.String, org.ehcache.config.CacheConfiguration) method. For any non null value returned, the Cache will be configured to use the CacheLoaderWriter instance returned.


Method Summary
<K,V> CacheLoaderWriter<? super K,V>
createCacheLoaderWriter(java.lang.String alias, CacheConfiguration<K,V> cacheConfiguration)
          Invoked by the CacheManager when a Cache is being added to it.
 void releaseCacheLoaderWriter(CacheLoaderWriter<?,?> cacheLoaderWriter)
          Invoked by CacheManager when a Cache is being removed from it.
 
Methods inherited from interface org.ehcache.spi.service.Service
start, stop
 

Method Detail

createCacheLoaderWriter

<K,V> CacheLoaderWriter<? super K,V> createCacheLoaderWriter(java.lang.String alias,
                                                             CacheConfiguration<K,V> cacheConfiguration)
Invoked by the CacheManager when a Cache is being added to it.

Type Parameters:
K - the key type for the associated Cache
V - the value type for the associated Cache
Parameters:
alias - the Cache instance's alias in the CacheManager
cacheConfiguration - the configuration instance that will be used to create the Cache
Returns:
the CacheLoaderWriter to be used by the Cache or null if none

releaseCacheLoaderWriter

void releaseCacheLoaderWriter(CacheLoaderWriter<?,?> cacheLoaderWriter)
                              throws java.lang.Exception
Invoked by CacheManager when a Cache is being removed from it.

Parameters:
cacheLoaderWriter - the CacheLoaderWriter that was initially associated with the Cache being removed
Throws:
java.lang.Exception - when the release fails