O'Reilly logo

Hands-On High Performance with Spring 5 by Dinesh Radadiya, Prashant Goswami, Pritesh Shah, Subhash Shah, Chintan Mehta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implementing the caching configuration class

We have created the following class, which will provide the UserCache bean that will provide it to AuthenticationProvider:

@Configuration@EnableCachingpublic class SpringMvcCacheConfig {  @Bean  public EhCacheFactoryBean ehCacheFactoryBean() {    EhCacheFactoryBean ehCacheFactory = new EhCacheFactoryBean();    ehCacheFactory.setCacheManager(cacheManagerFactoryBean()    .getObject());    return ehCacheFactory;  }  @Bean  public CacheManager cacheManager() {    return new             EhCacheCacheManager(cacheManagerFactoryBean().getObject());  }  @Bean  public EhCacheManagerFactoryBean cacheManagerFactoryBean() {    EhCacheManagerFactoryBean cacheManager = new     EhCacheManagerFactoryBean();    return cacheManager;  }  @Bean public UserCache ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required