Functional gateway bean definitions

* Rework `MessagingGatewayRegistrar` to parse messaging gateway annotation
an `<gateway>` XML using a supplier variant for bean definition.
Such a feature is required by Spring Native - otherwise we would need to
register reflection info for to many internal Spring Integration classes
* Such a change should benefit from regular JDK perspective, too -
we don't do reflection for this kind of bean registrations
This commit is contained in:
Artem Bilan
2021-07-02 14:59:40 -04:00
committed by Gary Russell
parent 1ac163330e
commit db4f120dac
3 changed files with 223 additions and 115 deletions

View File

@@ -181,7 +181,7 @@ public class GatewayParserTests {
ConfigurableListableBeanFactory beanFactory = ((GenericApplicationContext) context).getBeanFactory();
Object attribute =
beanFactory.getMergedBeanDefinition("&oneWay").getAttribute(FactoryBean.OBJECT_TYPE_ATTRIBUTE);
assertThat(attribute).isEqualTo(TestService.class.getName());
assertThat(attribute).isEqualTo(TestService.class);
}
@Test
@@ -189,7 +189,7 @@ public class GatewayParserTests {
ConfigurableListableBeanFactory beanFactory = ((GenericApplicationContext) context).getBeanFactory();
Object attribute =
beanFactory.getMergedBeanDefinition("&defaultConfig").getAttribute(FactoryBean.OBJECT_TYPE_ATTRIBUTE);
assertThat(attribute).isEqualTo(RequestReplyExchanger.class.getName());
assertThat(attribute).isEqualTo(RequestReplyExchanger.class);
}
@Test