public List<ValidationProvider<?>> getValidationProviders() {
ClassLoader classloader = GetClassLoader.fromContext();
if ( classloader == null ) {
classloader = GetClassLoader.fromClass( DefaultValidationProviderResolver.class );
}
List<ValidationProvider<?>> providers;
synchronized ( providersPerClassloader ) {
providers = providersPerClassloader.get( classloader );
}
if ( providers == null ) {
providers = new ArrayList<ValidationProvider<?>>();
String name = null;
try {
Enumeration<URL> providerDefinitions = classloader.getResources( SERVICES_FILE );
while ( providerDefinitions.hasMoreElements() ) {
...
}
}
...
synchronized ( providersPerClassloader ) {
providersPerClassloader.put( classloader, providers );
}
}
return providers;
}