List of usage examples for org.springframework.messaging.core DestinationResolutionException getCause
public synchronized Throwable getCause()
From source file:org.springframework.integration.config.annotation.AbstractMethodAnnotationPostProcessor.java
protected AbstractEndpoint createEndpoint(MessageHandler handler, Method method, List<Annotation> annotations) { AbstractEndpoint endpoint = null;/*from w w w .j av a2 s .com*/ String inputChannelName = MessagingAnnotationUtils.resolveAttribute(annotations, getInputChannelAttribute(), String.class); if (StringUtils.hasText(inputChannelName)) { MessageChannel inputChannel; try { inputChannel = this.channelResolver.resolveDestination(inputChannelName); } catch (DestinationResolutionException e) { if (e.getCause() instanceof NoSuchBeanDefinitionException) { inputChannel = new DirectChannel(); this.beanFactory.registerSingleton(inputChannelName, inputChannel); inputChannel = (MessageChannel) this.beanFactory.initializeBean(inputChannel, inputChannelName); } else { throw e; } } Assert.notNull(inputChannel, "failed to resolve inputChannel '" + inputChannelName + "'"); endpoint = doCreateEndpoint(handler, inputChannel, annotations); } return endpoint; }