spring-framework / org.springframework.cache.ehcache / EhCacheManagerUtils / buildCacheManager

buildCacheManager

open static fun buildCacheManager(): CacheManager

Build an EhCache CacheManager from the default configuration.

The CacheManager will be configured from "ehcache.xml" in the root of the class path (that is, default EhCache initialization - as defined in the EhCache docs - will apply). If no configuration file can be found, a fail-safe fallback configuration will be used.

Exceptions

CacheException - in case of configuration parsing failure

Return
the new EhCache CacheManager

open static fun buildCacheManager(name: String): CacheManager

Build an EhCache CacheManager from the default configuration.

The CacheManager will be configured from "ehcache.xml" in the root of the class path (that is, default EhCache initialization - as defined in the EhCache docs - will apply). If no configuration file can be found, a fail-safe fallback configuration will be used.

Parameters

name - the desired name of the cache manager

Exceptions

CacheException - in case of configuration parsing failure

Return
the new EhCache CacheManager

open static fun buildCacheManager(configLocation: Resource): CacheManager

Build an EhCache CacheManager from the given configuration resource.

Parameters

configLocation - the location of the configuration file (as a Spring resource)

Exceptions

CacheException - in case of configuration parsing failure

Return
the new EhCache CacheManager

open static fun buildCacheManager(name: String, configLocation: Resource): CacheManager

Build an EhCache CacheManager from the given configuration resource.

Parameters

name - the desired name of the cache manager

configLocation - the location of the configuration file (as a Spring resource)

Exceptions

CacheException - in case of configuration parsing failure

Return
the new EhCache CacheManager