Lucio Lelii 2016-09-22 08:57:48 +00:00
parent eb941576f5
commit 2f2620b800
1 changed files with 5 additions and 1 deletions

View File

@ -38,6 +38,7 @@ public class AuthorizationEndpointScanner {
Unmarshaller um = context.createUnmarshaller();
String defaultInfrastructure = null;
int defaultInfraPriority= Integer.MAX_VALUE;
ClasspathScanner scanner = ClasspathScannerFactory.scanner();
for (ClasspathResource r : scanner.scan(new NameMatcher(configurationPattern))){
@ -45,10 +46,13 @@ public class AuthorizationEndpointScanner {
if (defaultInfrastructure==null)
defaultInfrastructure = endpoint.getInfrastructure();
if (!endpointsMap.containsKey(endpoint.getInfrastructure())
|| endpointsMap.get(endpoint.getInfrastructure()).getPriority()> endpoint.getPriority()){
if ((r.name()).startsWith("default"))
if ((r.name()).startsWith("default") && endpoint.getPriority()<defaultInfraPriority ){
defaultInfrastructure = endpoint.getInfrastructure();
defaultInfraPriority = endpoint.getPriority();
}
endpointsMap.put(endpoint.getInfrastructure().hashCode(), endpoint);
}