public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { if (StringUtils.isEmpty(userCacheBean)) { if (applicationContext.containsBean(userServiceBean)) { userDetailsService = (UserDetailsService) applicationContext .getBean(userServiceBean); } else { throw new RuntimeException("Can not found spring bean[" + userServiceBean + "] implements " + UserDetailsService.class.getName() + " interface!"); } } else { if (applicationContext.containsBean(userCacheBean)) { userCache = (UserCache) applicationContext .getBean(userServiceBean); } else { throw new RuntimeException("Can not found spring bean[" + userCacheBean + "] implements " + UserCache.class.getName() + " interface!"); } } }
@Bean DigestAuthenticationFilter digestFilter(DigestAuthenticationEntryPoint digestAuthenticationEntryPoint, UserCache digestUserCache, UserDetailsService userDetailsService) { DigestAuthenticationFilter filter = new DigestAuthenticationFilter(); filter.setAuthenticationEntryPoint(digestAuthenticationEntryPoint); filter.setUserDetailsService(userDetailsService); filter.setUserCache(digestUserCache); return filter; }
@Override public UserCache getUserCache() { if (log.isDebugEnabled()) { log.debug("Invoking getUserCache"); } return super.getUserCache(); }
@Override public void setUserCache(UserCache userCache) { if (log.isDebugEnabled()) { log.debug("Invoking setUserCache"); } super.setUserCache(userCache); }
@Override public void setUserCache(UserCache userCache) { if (log.isDebugEnabled()) { log.debug("Invoking setuserCache"); } super.setUserCache(userCache); }
@Bean UserCache digestUserCache() throws Exception { return new SpringCacheBasedUserCache(new ConcurrentMapCache("digestUserCache")); }
/** * * @param userCache * Set the user cache */ @Autowired(required = false) public final void setUserCache(final UserCache userCache) { Assert.notNull(userCache, "userCache cannot be null"); this.userCache = userCache; }
public void setUserCache(UserCache userCache) { this.userCache = userCache; }
public UserCache getUserCache() { return userCache; }
/** * @param userCache the userCache to set */ public void setUserCache( UserCache userCache ) { this.userCache = userCache; }