Fix GatewayProxyInstPProc for AOT expectations

Turns out the AOT engine deals only with indexed constructor arguments for bean definition

* Rework `GatewayProxyInstantiationPostProcessor.processAheadOfTime()`
to populate a service interface type as an indexed ctor argument instead of generic one
This commit is contained in:
abilan
2022-11-15 13:33:53 -05:00
parent e19e6d4726
commit 4d2a4cad76

View File

@@ -88,7 +88,7 @@ class GatewayProxyInstantiationPostProcessor implements
if (beanClass.isInterface() && AnnotatedElementUtils.hasAnnotation(beanClass, MessagingGateway.class)) {
RootBeanDefinition beanDefinition = registeredBean.getMergedBeanDefinition();
beanDefinition.setBeanClass(AnnotationGatewayProxyFactoryBean.class);
beanDefinition.getConstructorArgumentValues().addGenericArgumentValue(beanClass);
beanDefinition.getConstructorArgumentValues().addIndexedArgumentValue(0, beanClass);
beanDefinition.setTargetType(
ResolvableType.forClassWithGenerics(AnnotationGatewayProxyFactoryBean.class, beanClass));
}