/**
* @see org.acegisecurity.userdetails.UserDetailsService#loadUserByUsername(java.lang.String)
*/
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
User u = null;
u = userCache.get(username);
if (u != null) {
return u;
}
List users = getHibernateTemplate().find("from User where username=?", username);
if (users == null || users.isEmpty()) {
throw new UsernameNotFoundException("user '" + username + "' not found...");
} else {
u = (User) users.get(0);
userCache.put(u.getUsername(), u);
return u;
}
}