@Override public Message<?> sendAndReceive(MessageChannel destination, Message<?> requestMessage) { if (!this.throwExceptionOnLateReplySet) { synchronized (this) { if (!this.throwExceptionOnLateReplySet) { Properties integrationProperties = IntegrationContextUtils.getIntegrationProperties(this.beanFactory); Boolean throwExceptionOnLateReply = Boolean.valueOf( integrationProperties.getProperty( IntegrationProperties.THROW_EXCEPTION_ON_LATE_REPLY)); super.setThrowExceptionOnLateReply(throwExceptionOnLateReply); this.throwExceptionOnLateReplySet = true; } } } return super.sendAndReceive(destination, requestMessage); }
/** * Invokes {@code setDefaultDestination(MessageChannel)} - provided for backward compatibility. * * @param channel the channel to set. */ public void setDefaultChannel(MessageChannel channel) { super.setDefaultDestination(channel); }
/** Overridden to set the destination resolver to a {@link BeanFactoryChannelResolver}. */ @Override public void setBeanFactory(BeanFactory beanFactory) throws BeansException { this.beanFactory = beanFactory; // NOSONAR - non-sync is ok here super.setDestinationResolver(new BeanFactoryChannelResolver(beanFactory)); }
@Override public void setThrowExceptionOnLateReply(boolean throwExceptionOnLateReply) { super.setThrowExceptionOnLateReply(throwExceptionOnLateReply); this.throwExceptionOnLateReplySet = true; }
/** * Create a MessagingTemplate with the given default channel. * * @param defaultChannel the default {@link MessageChannel} for {@code send} operations */ public MessagingTemplate(MessageChannel defaultChannel) { super.setDefaultDestination(defaultChannel); }