We now use the API newly introduced in Spring Framework 6.2.3 / 7.0 M2 to select filtered bean instances from an ObjectProvider (via ….stream(Predicate<Class<?>> filter)). This allows us to avoid having to proxy a List as the ultimate target for the plugin registry. Instead, we can switch to a simple Supplier (SingletonSupplier in particular) to delay the actual bean lookup.
String first pass of refactorings and reducing the exposure of intermediate types previously necessary to also be able to handle the ability to inject lists of beans (see GH-107). Also remove the previously AOT runtime hints registration.
We now set a fully genericised root bean type in the first place, tweak the bean definition's target type as we did before but still set the beanClass property to the original PluginRegistryFactoryBean type.
The introduced methods mostly mimic the ones available on OrderAwarePluginRegistry except the one that's implying a certain order in the first place. Also introduced ….of(…) factory methods on OrderAwarePluginRegistry and deprecated the ….create(…) ones.
Removed deprecated use of InvertibleComparator in favor of Java 8's Comparator.reversed(). Made comparator field final. Added non-null assertions. Removed superfluous generic method type hints. Javadoc.
Added aforementioned method for clients to look up a required plugin with the registry throwing a default exception if none is found. An overload taking a Supplier<String> is available to customize the exception message if needed.
Moved to Optional instead of null values in the API. Removed deprecated methods in favor of methods taking a Supplier for both exceptions to be thrown or plugin defaults.
We now consistently use Assert.notNull(…) et al that take an error message as the overload without a message have been deprecated in Spring 5.
Added build profile for Spring 5 releases and snapshots.
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.
Introduced overloads on PluginRegistry which instead of taking an exception instance immediately (which requires instance creation beforehand) now accept a Supplier<E> so that the exception creation can actually be delayed until it's really needed.
Deprecated the old methods taking exception instances directly.
AbstractTypeAwareSupport now takes an array of type to be excluded from the bean lookup. The BeansOfTypeTaregtSource's actual bean lookup was changed to not trigger bean creation of types to be excluded.
Improved constructor delegation in OrderAwarePluginRegistry correctly passing empty collections instead of null now. SimplePluginRegistry avoids to look up all plugins for the getPluginFor(…) call. Instead it eagerly returns the first one matching immediately.
Introduced PluginRegistrySupport base class to make sure we create a copy of the plugin list on first access to it as otherwise the sorting calls get lost in the proxy created by the AbstractTypeAwareSupport.
Removed MutablePluginRegistry interfaces and implementation along the way as it causes more bad than good currently and there doesn't seem to be a real need for it.
* made @SimplePluginRegistry@ safe against @null@ values
git-svn-id: svn+ssh://svn.synyx.de/var/svn/synyx/opensource/hera/trunk@8546 5a64d73e-33d6-4ccc-9058-23f8668ecac9
* created dedicated method for setting a @Comparator@ to clean up internal code
* use @plugins@ property for sorting access instead of @getPlugins@ which returns an immutable @List@ now
git-svn-id: svn+ssh://svn.synyx.de/var/svn/synyx/opensource/hera/trunk@8543 5a64d73e-33d6-4ccc-9058-23f8668ecac9