Allow all discovery implementations to bubble up

Hope that one is chosen by @Conditionals. The tests all pass
but this could get hairy when we start to get more discovery
implementations.
This commit is contained in:
Dave Syer
2015-05-21 15:52:43 +01:00
parent c2d1c0356c
commit c6b4d6da9d

View File

@@ -17,7 +17,6 @@
package org.springframework.cloud.util;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.List;
@@ -77,11 +76,9 @@ public abstract class SingleImplementationImportSelector<T> implements
}
if (factories.size() > 1) {
String factory = factories.get(0);
// there should only every be one DiscoveryClient
// there should only ever be one DiscoveryClient, but there might be more than one factory
log.warn("More than one implementation " + "of @" + getSimpleName()
+ ". Using " + factory + " out of available " + factories);
factories = Collections.singletonList(factory);
+ " (now relying on @Conditionals to pick one): " + factories);
}
return factories.toArray(new String[factories.size()]);