org.ehcache.spi.loaderwriter
Interface CacheLoaderWriterProvider

All Superinterfaces:
Service

public interface CacheLoaderWriterProvider
extends Service

A Service that creates CacheLoaderWriter instances.

A CacheManager will use the createCacheLoaderWriter(java.lang.String, org.ehcache.config.CacheConfiguration) method to create CacheLoaderWriter instances for each Cache it manages.

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)
          Creates a CacheLoaderWriter for use with the Cache of the given alias and configuration.
 void releaseCacheLoaderWriter(CacheLoaderWriter<?,?> cacheLoaderWriter)
          Releases a CacheLoaderWriter when the associated Cache is finished with 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)
Creates a CacheLoaderWriter for use with the Cache of the given alias and configuration.

Type Parameters:
K - the loader-writer key type
V - the loader-writer value type
Parameters:
alias - the Cache alias in the CacheManager
cacheConfiguration - the configuration for the associated cache
Returns:
the CacheLoaderWriter to be used by the Cache or null if none

releaseCacheLoaderWriter

void releaseCacheLoaderWriter(CacheLoaderWriter<?,?> cacheLoaderWriter)
                              throws java.lang.Exception
Releases a CacheLoaderWriter when the associated Cache is finished with it.

If the CacheLoaderWriter instance was user provided close will not be invoked.

Parameters:
cacheLoaderWriter - the CacheLoaderWriter being released
Throws:
java.lang.Exception - when the release fails