public class SpringCacheManager
extends java.lang.Object
implements com.okta.sdk.cache.CacheManager, org.springframework.beans.factory.InitializingBean
CacheManager implementation that wraps a Spring
CacheManager instance. This allows the Okta SDK to use your
existing Spring caching mechanism so you only need to configure one caching implementation.
This implementation effectively acts as an adapter or bridge from the Okta SDK cacheManager API to the Spring CacheManager API.
| Constructor and Description |
|---|
SpringCacheManager() |
SpringCacheManager(org.springframework.cache.CacheManager springCacheManager)
Constructs a new
SpringCacheManager instance that wraps (delegates to) the specified
Spring CacheManager instance. |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
<K,V> com.okta.sdk.cache.Cache<K,V> |
getCache(java.lang.String name)
Consults the wrapped Spring
CacheManager instance to obtain a
named Spring Cache instance. |
void |
setSpringCacheManager(org.springframework.cache.CacheManager cacheManager) |
public SpringCacheManager()
public SpringCacheManager(org.springframework.cache.CacheManager springCacheManager)
SpringCacheManager instance that wraps (delegates to) the specified
Spring CacheManager instance.springCacheManager - the target Spring cache manager to wrap.public void setSpringCacheManager(org.springframework.cache.CacheManager cacheManager)
public void afterPropertiesSet()
throws java.lang.Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanjava.lang.Exceptionpublic <K,V> com.okta.sdk.cache.Cache<K,V> getCache(java.lang.String name)
CacheManager instance to obtain a
named Spring Cache instance. The instance is wrapped and returned as a
SpringCache instance, which acts as a bridge/adapter over Spring's existing Cache API.getCache in interface com.okta.sdk.cache.CacheManagerK - The cache key typeV - The cache value typename - the name of the cache to acquire.Copyright © 2017-2020 Okta. All Rights Reserved.