Updates for Spring > 4.0.3

This commit is contained in:
Dave Syer
2016-04-04 11:46:51 +01:00
parent 71f1c363cc
commit 72cf5256e8
2 changed files with 4 additions and 4 deletions

View File

@@ -15,7 +15,7 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
<version>4.0.3.RELEASE</version>
<version>4.2.5.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>

View File

@@ -39,7 +39,7 @@ public class SpringInjector implements Injector {
public SpringInjector(ApplicationContext context) {
this.beanFactory = (DefaultListableBeanFactory) context.getAutowireCapableBeanFactory();
if (context.getBeanNamesForType(Injector.class).length>0) {
if (context.getBeanNamesForType(Injector.class, true, false).length>0) {
this.injector = context.getBean(Injector.class);
}
}
@@ -104,7 +104,7 @@ public class SpringInjector implements Injector {
@Override
public <T> Provider<T> getProvider(Class<T> type) {
if (beanFactory.getBeanNamesForType(type).length==0) {
if (beanFactory.getBeanNamesForType(type, true, false).length==0) {
if (injector!=null && injector.getExistingBinding(Key.get(type))!=null) {
return injector.getProvider(type);
}
@@ -130,7 +130,7 @@ public class SpringInjector implements Injector {
@Override
public <T> T getInstance(Class<T> type) {
if (beanFactory.getBeanNamesForType(type).length==0) {
if (beanFactory.getBeanNamesForType(type, true, false).length==0) {
if (injector!=null && injector.getExistingBinding(Key.get(type))!=null) {
return injector.getInstance(type);
}