use of org.springframework.integration.support.channel.BeanFactoryChannelResolver in project spring-integration by spring-projects.
the class ReactiveStreamsConsumer method onInit.
@Override
protected void onInit() throws Exception {
super.onInit();
if (this.errorHandler == null) {
Assert.notNull(getBeanFactory(), "BeanFactory is required");
this.errorHandler = new MessagePublishingErrorHandler(new BeanFactoryChannelResolver(getBeanFactory()));
}
}
use of org.springframework.integration.support.channel.BeanFactoryChannelResolver in project spring-integration by spring-projects.
the class GatewayProxyFactoryBean method onInit.
@Override
protected void onInit() {
synchronized (this.initializationMonitor) {
if (this.initialized) {
return;
}
BeanFactory beanFactory = this.getBeanFactory();
if (this.channelResolver == null && beanFactory != null) {
this.channelResolver = new BeanFactoryChannelResolver(beanFactory);
}
Class<?> proxyInterface = this.determineServiceInterface();
Method[] methods = ReflectionUtils.getUniqueDeclaredMethods(proxyInterface);
for (Method method : methods) {
MethodInvocationGateway gateway = this.createGatewayForMethod(method);
this.gatewayMap.put(method, gateway);
}
this.serviceProxy = new ProxyFactory(proxyInterface, this).getProxy(this.beanClassLoader);
if (this.asyncExecutor != null) {
Callable<String> task = () -> null;
Future<String> submitType = this.asyncExecutor.submit(task);
this.asyncSubmitType = submitType.getClass();
if (this.asyncExecutor instanceof AsyncListenableTaskExecutor) {
submitType = ((AsyncListenableTaskExecutor) this.asyncExecutor).submitListenable(task);
this.asyncSubmitListenableType = submitType.getClass();
}
}
this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory());
this.initialized = true;
}
}
use of org.springframework.integration.support.channel.BeanFactoryChannelResolver in project spring-integration by spring-projects.
the class PublisherAnnotationAdvisor method setBeanFactory.
@Override
public void setBeanFactory(BeanFactory beanFactory) {
this.interceptor.setChannelResolver(new BeanFactoryChannelResolver(beanFactory));
this.interceptor.setBeanFactory(beanFactory);
}
use of org.springframework.integration.support.channel.BeanFactoryChannelResolver in project spring-integration by spring-projects.
the class MessageBusParserTests method testErrorChannelReference.
@Test
public void testErrorChannelReference() {
ConfigurableApplicationContext context = new ClassPathXmlApplicationContext("messageBusWithErrorChannel.xml", this.getClass());
BeanFactoryChannelResolver resolver = new BeanFactoryChannelResolver(context);
assertEquals(context.getBean("errorChannel"), resolver.resolveDestination("errorChannel"));
context.close();
}
use of org.springframework.integration.support.channel.BeanFactoryChannelResolver in project spring-integration by spring-projects.
the class MessagingTemplate method setBeanFactory.
/**
* Overridden to set the destination resolver to a {@link BeanFactoryChannelResolver}.
*/
@Override
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
// NOSONAR - non-sync is ok here
this.beanFactory = beanFactory;
super.setDestinationResolver(new BeanFactoryChannelResolver(beanFactory));
}
Aggregations