spring-framework / org.springframework.cache.concurrent / ConcurrentMapCacheFactoryBean

ConcurrentMapCacheFactoryBean

open class ConcurrentMapCacheFactoryBean : FactoryBean<ConcurrentMapCache>, BeanNameAware, InitializingBean

FactoryBean for easy configuration of a ConcurrentMapCache when used within a Spring container. Can be configured through bean properties; uses the assigned Spring bean name as the default cache name.

Useful for testing or simple caching scenarios, typically in combination with org.springframework.cache.support.SimpleCacheManager or dynamically through ConcurrentMapCacheManager.

Author
Costin Leau

Author
Juergen Hoeller

Since
3.1

Constructors

<init>

ConcurrentMapCacheFactoryBean()

FactoryBean for easy configuration of a ConcurrentMapCache when used within a Spring container. Can be configured through bean properties; uses the assigned Spring bean name as the default cache name.

Useful for testing or simple caching scenarios, typically in combination with org.springframework.cache.support.SimpleCacheManager or dynamically through ConcurrentMapCacheManager.

Functions

afterPropertiesSet

open fun afterPropertiesSet(): Unit

getObject

open fun getObject(): ConcurrentMapCache

getObjectType

open fun getObjectType(): Class<*>

isSingleton

open fun isSingleton(): Boolean

setAllowNullValues

open fun setAllowNullValues(allowNullValues: Boolean): Unit

Set whether to allow null values (adapting them to an internal null holder value).

Default is "true".

setBeanName

open fun setBeanName(beanName: String): Unit

setName

open fun setName(name: String): Unit

Specify the name of the cache.

Default is "" (empty String).

setStore

open fun setStore(store: ConcurrentMap<Any, Any>): Unit

Specify the ConcurrentMap to use as an internal store (possibly pre-populated).

Default is a standard java.util.concurrent.ConcurrentHashMap.