Rename SingleImplementationImportSelector to SpringFactoryImportSelector
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
package org.springframework.cloud.client.circuitbreaker;
|
||||
|
||||
import org.springframework.boot.bind.RelaxedPropertyResolver;
|
||||
import org.springframework.cloud.util.SingleImplementationImportSelector;
|
||||
import org.springframework.cloud.util.SpringFactoryImportSelector;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.core.annotation.Order;
|
||||
|
||||
@@ -27,7 +27,7 @@ import org.springframework.core.annotation.Order;
|
||||
*/
|
||||
@Order(Ordered.LOWEST_PRECEDENCE - 100)
|
||||
public class EnableCircuitBreakerImportSelector extends
|
||||
SingleImplementationImportSelector<EnableCircuitBreaker> {
|
||||
SpringFactoryImportSelector<EnableCircuitBreaker> {
|
||||
|
||||
@Override
|
||||
protected boolean isEnabled() {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
package org.springframework.cloud.client.discovery;
|
||||
|
||||
import org.springframework.boot.bind.RelaxedPropertyResolver;
|
||||
import org.springframework.cloud.util.SingleImplementationImportSelector;
|
||||
import org.springframework.cloud.util.SpringFactoryImportSelector;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.core.annotation.Order;
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.springframework.core.annotation.Order;
|
||||
*/
|
||||
@Order(Ordered.LOWEST_PRECEDENCE - 100)
|
||||
public class EnableDiscoveryClientImportSelector extends
|
||||
SingleImplementationImportSelector<EnableDiscoveryClient> {
|
||||
SpringFactoryImportSelector<EnableDiscoveryClient> {
|
||||
|
||||
@Override
|
||||
protected boolean isEnabled() {
|
||||
|
||||
@@ -33,13 +33,14 @@ import org.springframework.core.type.AnnotationMetadata;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* Selects a single configuration to load defined by the generic type T.
|
||||
* Selects configurations to load defined by the generic type T. Loads
|
||||
* implementations using {@link SpringFactoriesLoader}.
|
||||
*
|
||||
* @author Spencer Gibb
|
||||
* @author Dave Syer
|
||||
*/
|
||||
@CommonsLog
|
||||
public abstract class SingleImplementationImportSelector<T> implements
|
||||
public abstract class SpringFactoryImportSelector<T> implements
|
||||
DeferredImportSelector, BeanClassLoaderAware, EnvironmentAware {
|
||||
|
||||
private ClassLoader beanClassLoader;
|
||||
@@ -49,9 +50,9 @@ public abstract class SingleImplementationImportSelector<T> implements
|
||||
private Environment environment;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
protected SingleImplementationImportSelector() {
|
||||
protected SpringFactoryImportSelector() {
|
||||
this.annotationClass = (Class<T>) GenericTypeResolver.resolveTypeArgument(
|
||||
this.getClass(), SingleImplementationImportSelector.class);
|
||||
this.getClass(), SpringFactoryImportSelector.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -17,14 +17,13 @@
|
||||
package org.springframework.cloud.util;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.cloud.util.SingleImplementationImportSelector;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
/**
|
||||
* @author Spencer Gibb
|
||||
*/
|
||||
public class SingleImplementationImportSelectorTests {
|
||||
public class SpringFactoryImportSelectorTests {
|
||||
|
||||
@Test
|
||||
public void testFindAnnotation() {
|
||||
@@ -37,7 +36,7 @@ public class SingleImplementationImportSelectorTests {
|
||||
}
|
||||
|
||||
public static class MyAnnotationImportSelector extends
|
||||
SingleImplementationImportSelector<MyAnnotation> {
|
||||
SpringFactoryImportSelector<MyAnnotation> {
|
||||
|
||||
@Override
|
||||
protected boolean isEnabled() {
|
||||
Reference in New Issue
Block a user