open class EhCacheFactoryBean : CacheConfiguration, FactoryBean<Ehcache>, BeanNameAware, InitializingBean
FactoryBean that creates a named EhCache net.sf.ehcache.Cache instance (or a decorator that implements the net.sf.ehcache.Ehcache interface), representing a cache region within an EhCache net.sf.ehcache.CacheManager.
If the specified named cache is not configured in the cache configuration descriptor, this FactoryBean will construct an instance of a Cache with the provided name and the specified cache properties and add it to the CacheManager for later retrieval. If some or all properties are not set at configuration time, this FactoryBean will use defaults.
Note: If the named Cache instance is found, the properties will be ignored and the Cache instance will be retrieved from the CacheManager.
Note: As of Spring 5.0, Spring's EhCache support requires EhCache 2.10 or higher.
Author
Juergen Hoeller
Author
Dmitriy Kopylenko
Since
1.1.1
See Also
#setCacheManagerEhCacheManagerFactoryBeannet.sf.ehcache.Cache
EhCacheFactoryBean() |
open fun afterPropertiesSet(): Unit |
|
open fun getObject(): Ehcache |
|
open fun getObjectType(): Class<out Ehcache>
Predict the particular |
|
open fun isSingleton(): Boolean |
|
open fun setBeanName(name: String): Unit |
|
open fun setBlocking(blocking: Boolean): Unit
Set whether to use a blocking cache that lets read attempts block until the requested element is created. If you intend to build a self-populating blocking cache, consider specifying a |
|
open fun setBootstrapCacheLoader(bootstrapCacheLoader: BootstrapCacheLoader): Unit
Set an EhCache net.sf.ehcache.bootstrap.BootstrapCacheLoader for this cache, if any. |
|
open fun setCacheEntryFactory(cacheEntryFactory: CacheEntryFactory): Unit
Set an EhCache net.sf.ehcache.constructs.blocking.CacheEntryFactory to use for a self-populating cache. If such a factory is specified, the cache will be decorated with EhCache's net.sf.ehcache.constructs.blocking.SelfPopulatingCache. The specified factory can be of type net.sf.ehcache.constructs.blocking.UpdatingCacheEntryFactory, which will lead to the use of an net.sf.ehcache.constructs.blocking.UpdatingSelfPopulatingCache. Note: Any such self-populating cache is automatically a blocking cache. |
|
open fun setCacheEventListeners(cacheEventListeners: MutableSet<CacheEventListener>): Unit
Specify EhCache net.sf.ehcache.event.CacheEventListener to registered with this cache. |
|
open fun setCacheManager(cacheManager: CacheManager): Unit
Set a CacheManager from which to retrieve a named Cache instance. By default, Note that in particular for persistent caches, it is advisable to properly handle the shutdown of the CacheManager: Set up a separate EhCacheManagerFactoryBean and pass a reference to this bean property. A separate EhCacheManagerFactoryBean is also necessary for loading EhCache configuration from a non-default config location. |
|
open fun setCacheName(cacheName: String): Unit
Set a name for which to retrieve or create a cache instance. Default is the bean name of this EhCacheFactoryBean. |
|
open fun setDisabled(disabled: Boolean): Unit
Set whether this cache should be marked as disabled. |
|
open fun setDiskSpoolBufferSize(diskSpoolBufferSize: Int): Unit |
|
open fun setTimeToIdle(timeToIdle: Int): Unit |
|
open fun setTimeToLive(timeToLive: Int): Unit |