public interface CacheLoaderWriterProvider extends Service
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.
Modifier and Type | Method and Description |
---|---|
<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. |
CacheLoaderWriterConfiguration<?> |
getPreConfiguredCacheLoaderWriterConfig(java.lang.String alias)
Returns preconfigured
CacheLoaderWriterConfiguration for the given alias |
boolean |
isLoaderJsrProvided(java.lang.String alias)
Checks whether
CacheLoaderWriter was provided using jsr api |
void |
releaseCacheLoaderWriter(java.lang.String alias,
CacheLoaderWriter<?,?> cacheLoaderWriter)
Releases a
CacheLoaderWriter when the associated Cache
is finished with it. |
<K,V> CacheLoaderWriter<? super K,V> createCacheLoaderWriter(java.lang.String alias, CacheConfiguration<K,V> cacheConfiguration)
CacheLoaderWriter
for use with the Cache
of the given alias and configuration.K
- the loader-writer key typeV
- the loader-writer value typealias
- the Cache
alias in the CacheManager
cacheConfiguration
- the configuration for the associated cacheCacheLoaderWriter
to be used by the Cache
or null
if nonevoid releaseCacheLoaderWriter(java.lang.String alias, CacheLoaderWriter<?,?> cacheLoaderWriter) throws java.lang.Exception
CacheLoaderWriter
when the associated Cache
is finished with it.
If the CacheLoaderWriter
instance was user provided close
will not be invoked.
alias
- the Cache
alias in the CacheManager
cacheLoaderWriter
- the CacheLoaderWriter
being releasedjava.lang.Exception
- when the release failsCacheLoaderWriterConfiguration<?> getPreConfiguredCacheLoaderWriterConfig(java.lang.String alias)
CacheLoaderWriterConfiguration
for the given aliasalias
- the Cache
alias in the CacheManager
CacheLoaderWriterConfiguration
configured for the Cache
, otherwise nullboolean isLoaderJsrProvided(java.lang.String alias)
CacheLoaderWriter
was provided using jsr apialias
- the Cache
alias in the CacheManager
true
if CacheLoaderWriter
was provided using jsr api, otherwise false.