public interface CacheLoaderWriterProvider extends Service
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.| Modifier and Type | Method and Description |
|---|---|
<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. |
<K,V> CacheLoaderWriter<? super K,V> createCacheLoaderWriter(java.lang.String alias, CacheConfiguration<K,V> cacheConfiguration)
CacheManager when a Cache is being added to it.K - the key type for the associated CacheV - the value type for the associated Cachealias - the Cache instance's alias in the CacheManagercacheConfiguration - the configuration instance that will be used to create the CacheCacheLoaderWriter to be used by the Cache or null if nonevoid releaseCacheLoaderWriter(CacheLoaderWriter<?,?> cacheLoaderWriter) throws java.lang.Exception
CacheManager when a Cache is being removed from it.
If the cacheLoaderWriter instance is provided by the user, Closeable.close()
will not be invoked.cacheLoaderWriter - the CacheLoaderWriter that was initially associated with
the Cache being removedjava.lang.Exception - when the release fails