|
|
@ -25,7 +25,6 @@ import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.BeanFactory;
|
|
|
|
import org.springframework.beans.factory.BeanFactory;
|
|
|
|
import org.springframework.beans.factory.ListableBeanFactory;
|
|
|
|
import org.springframework.beans.factory.ListableBeanFactory;
|
|
|
|
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import static org.springframework.beans.factory.BeanFactoryUtils.beanNamesForTypeIncludingAncestors;
|
|
|
|
import static org.springframework.beans.factory.BeanFactoryUtils.beanNamesForTypeIncludingAncestors;
|
|
|
|
|
|
|
|
|
|
|
@ -39,7 +38,7 @@ public final class BeanFactoryUtils {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static <T> List<T> getBeans(BeanFactory beanFactory, Class<T> requiredType) {
|
|
|
|
public static <T> List<T> getBeans(BeanFactory beanFactory, Class<T> requiredType) {
|
|
|
|
if (!(beanFactory instanceof DefaultListableBeanFactory)) {
|
|
|
|
if (!(beanFactory instanceof ListableBeanFactory)) {
|
|
|
|
throw new RuntimeException("bean factory not support get list bean. factory type = " + beanFactory.getClass()
|
|
|
|
throw new RuntimeException("bean factory not support get list bean. factory type = " + beanFactory.getClass()
|
|
|
|
.getName());
|
|
|
|
.getName());
|
|
|
|
}
|
|
|
|
}
|
|
|
|