if (authenticator == null) {
synchronized (CrowdUtils.class) {
if (authenticator == null) {
ClientResourceLocator clientResourceLocator = new ClientResourceLocator("crowd.properties");
ClientProperties props = ClientPropertiesImpl.newInstanceFromResourceLocator(clientResourceLocator);
CrowdClientFactory clientFactory = new RestCrowdClientFactory();
CrowdClient client = clientFactory.newInstance(props);
CrowdHttpTokenHelper tokenHelper = CrowdHttpTokenHelperImpl
.getInstance(CrowdHttpValidationFactorExtractorImpl.getInstance());
authenticator = new CrowdHttpAuthenticatorImpl(client, props, tokenHelper);
}
}