class LdapAuthenticateManager {

    public Boolean authenticate(String userName, String password)
    {
        Map<String, LdapAuthenticateService> ldapAuthServiceMap = getSpringContextHolder().getAllBeansOfType(LdapAuthenticateService.class);

        Boolean authenticated = Boolean.FALSE;
        for (Map.Entry<String, LdapAuthenticateService> ldapAuthService : ldapAuthServiceMap.entrySet())
        {
            authenticated = ldapAuthService.getValue().authenticate(userName, password);
            if (authenticated)
            {
                break;
            }
        }
        return authenticated;
    }

}