Source:
<code>public void initialize() throws Exception { <START> synchronized(LdapRolesProvider.class) { <END> if (lbLdap == null) { environment = (String) options.get(ENVIRONMENT); LdapConfiguration ldapConf = new LdapConfiguration(); ldapConf.server((String) options.get(SERVER)); ldapConf.port(Integer.parseInt((String) options.get(PORT))); String searchBase = (String) options.get(SEARCH_BASE); ldapConf.bindDn((String) options.get(BIND_DN)); ldapConf.bindDNPwd((String) options.get(BIND_PWD)); ldapConf.useSSL(Boolean.parseBoolean( (String) options.get(USE_SSL))); ldapConf.trustStore((String) options.get(TRUST_STORE)); ldapConf.trustStorePassword((String) options.get(TRUST_STORE_PASSWORD)); ldapConf.poolSize(Integer.parseInt((String) options.get(POOL_SIZE))); if (options.containsKey(CONNECTION_TIMEOUT_MS)) { ldapConf.connectionTimeoutMS(Integer.parseInt((String)options.get(CONNECTION_TIMEOUT_MS))); } if (options.containsKey(RESPONSE_TIMEOUT_MS)) { ldapConf.responseTimeoutMS(Integer.parseInt((String)options.get(RESPONSE_TIMEOUT_MS))); } if (options.containsKey(DEBUG)) { ldapConf.debug(Boolean.parseBoolean((String)options.get(DEBUG))); } if (options.containsKey(KEEP_ALIVE)) { ldapConf.keepAlive(Boolean.parseBoolean((String)options.get(KEEP_ALIVE))); } if (options.containsKey(POOL_MAX_CONNECTION_AGE_MS)) { ldapConf.poolMaxConnectionAgeMS(Integer.parseInt((String)options.get(POOL_MAX_CONNECTION_AGE_MS))); } int rolesCacheExpiry = 5*60*1000; if (options.containsKey(ROLES_CACHE_EXPIRY_MS)) { rolesCacheExpiry = Integer.parseInt((String)options.get(ROLES_CACHE_EXPIRY_MS)); } lbLdap = new CachedRolesProvider(new LdapRolesProvider(searchBase, ldapConf), new RolesCache(rolesCacheExpiry)); } } }</code><technical_language>This synchronize time initialize is called. volatile</technical_language>

Target:
public void initialize() throws Exception { if (lbLdap == null) { synchronized(LdapRolesProvider.class) { if (lbLdap == null) { environment = (String) options.get(ENVIRONMENT); LdapConfiguration ldapConf = new LdapConfiguration(); ldapConf.server((String) options.get(SERVER)); ldapConf.port(Integer.parseInt((String) options.get(PORT))); String searchBase = (String) options.get(SEARCH_BASE); ldapConf.bindDn((String) options.get(BIND_DN)); ldapConf.bindDNPwd((String) options.get(BIND_PWD)); ldapConf.useSSL(Boolean.parseBoolean( (String) options.get(USE_SSL))); ldapConf.trustStore((String) options.get(TRUST_STORE)); ldapConf.trustStorePassword((String) options.get(TRUST_STORE_PASSWORD)); ldapConf.poolSize(Integer.parseInt((String) options.get(POOL_SIZE))); if (options.containsKey(CONNECTION_TIMEOUT_MS)) { ldapConf.connectionTimeoutMS(Integer.parseInt((String)options.get(CONNECTION_TIMEOUT_MS))); } if (options.containsKey(RESPONSE_TIMEOUT_MS)) { ldapConf.responseTimeoutMS(Integer.parseInt((String)options.get(RESPONSE_TIMEOUT_MS))); } if (options.containsKey(DEBUG)) { ldapConf.debug(Boolean.parseBoolean((String)options.get(DEBUG))); } if (options.containsKey(KEEP_ALIVE)) { ldapConf.keepAlive(Boolean.parseBoolean((String)options.get(KEEP_ALIVE))); } if (options.containsKey(POOL_MAX_CONNECTION_AGE_MS)) { ldapConf.poolMaxConnectionAgeMS(Integer.parseInt((String)options.get(POOL_MAX_CONNECTION_AGE_MS))); } int rolesCacheExpiry = 5*60*1000; if (options.containsKey(ROLES_CACHE_EXPIRY_MS)) { rolesCacheExpiry = Integer.parseInt((String)options.get(ROLES_CACHE_EXPIRY_MS)); } lbLdap = new CachedRolesProvider(new LdapRolesProvider(searchBase, ldapConf), new RolesCache(rolesCacheExpiry)); } } } }