#18 - Explicitly declare bean definitions target type for plugin registries.

We now use the API introduced in Spring Framework 4.3.3 to explicitly declare a ResolvableType for the BeanDefinition of the plugin registries. This allows to autowire registries as PluginRegisty<Foo, …> and PluginRegistry<Bar, …> without using explicit qualifiers.
This commit is contained in:
Oliver Gierke
2016-08-30 11:53:32 +02:00
parent 1feb021ee3
commit a800aa0ecc
2 changed files with 33 additions and 14 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012 the original author or authors.
* Copyright 2012-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -50,9 +50,7 @@ public class EnablePluginRegistriesIntegrationTest {
}
}
@Autowired
@Qualifier("samplePluginRegistry")
PluginRegistry<SamplePlugin, String> registry;
@Autowired PluginRegistry<SamplePlugin, String> registry;
@Test
public void registersPluginRegistries() {
@@ -60,9 +58,7 @@ public class EnablePluginRegistriesIntegrationTest {
}
@Qualifier("myQualifier")
interface AnotherPlugin extends Plugin<String> {
}
interface AnotherPlugin extends Plugin<String> {}
static class AnotherSamplePluginImplementation implements AnotherPlugin {