@Override public void setBeanFactory(BeanFactory beanFactory) throws BeansException { this.beanFactory = beanFactory; this.messagingTemplate.setBeanFactory(beanFactory); }
/** * Obtain a {@link MessagingTemplate} with its default destination set to the input channel * of the {@link IntegrationFlow}. * <p> Any {@link IntegrationFlow} bean (not only manually registered) can be used for this method. * <p> If {@link IntegrationFlow} doesn't start with the {@link MessageChannel}, the * {@link IllegalStateException} is thrown. * @return the {@link MessagingTemplate} instance */ @Override public MessagingTemplate getMessagingTemplate() { if (this.messagingTemplate == null) { this.messagingTemplate = new MessagingTemplate(getInputChannel()) { @Override public Message<?> receive() { return receiveAndConvert(Message.class); } @Override public <T> T receiveAndConvert(Class<T> targetClass) { throw new UnsupportedOperationException("The 'receive()/receiveAndConvert()' " + "isn't supported on the 'IntegrationFlow' input channel."); } }; this.messagingTemplate.setBeanFactory(this.beanFactory); } return this.messagingTemplate; }
@Override protected void onInit() { Assert.notNull(this.source, "source must not be null"); Assert.state((this.outputChannelName == null && this.outputChannel != null) || (this.outputChannelName != null && this.outputChannel == null), "One and only one of 'outputChannelName' or 'outputChannel' is required."); super.onInit(); if (this.getBeanFactory() != null) { this.messagingTemplate.setBeanFactory(this.getBeanFactory()); } }
@Override protected void onInit() { super.onInit(); Assert.state(!(this.defaultOutputChannelName != null && this.defaultOutputChannel != null), "'defaultOutputChannelName' and 'defaultOutputChannel' are mutually exclusive."); if (this.getBeanFactory() != null) { this.messagingTemplate.setBeanFactory(this.getBeanFactory()); } }
@Override protected void onInit() { super.onInit(); if (this.getBeanFactory() != null) { this.messagingTemplate.setBeanFactory(this.getBeanFactory()); } }
@Override protected void onInit() { super.onInit(); Assert.state(!(this.outputChannelName != null && this.outputChannel != null), //NOSONAR (inconsistent sync) "'outputChannelName' and 'outputChannel' are mutually exclusive."); if (getBeanFactory() != null) { this.messagingTemplate.setBeanFactory(getBeanFactory()); } this.messagingTemplate.setDestinationResolver(getChannelResolver()); }
@Override protected void onInit() { try { super.onInit(); } catch (Exception e) { throw new BeanInitializationException("Cannot initialize: " + this, e); } if (this.getBeanFactory() != null) { this.messagingTemplate.setBeanFactory(this.getBeanFactory()); } }
@Override protected void onInit() { Assert.state(!(this.requestChannelName != null && this.requestChannel != null), "'requestChannelName' and 'requestChannel' are mutually exclusive."); Assert.state(!(this.replyChannelName != null && this.replyChannel != null), "'replyChannelName' and 'replyChannel' are mutually exclusive."); Assert.state(!(this.errorChannelName != null && this.errorChannel != null), "'errorChannelName' and 'errorChannel' are mutually exclusive."); this.historyWritingPostProcessor.setTrackableComponent(this); this.historyWritingPostProcessor.setMessageBuilderFactory(this.getMessageBuilderFactory()); if (this.getBeanFactory() != null) { this.messagingTemplate.setBeanFactory(this.getBeanFactory()); if (this.requestMapper instanceof DefaultRequestMapper) { ((DefaultRequestMapper) this.requestMapper).setMessageBuilderFactory(this.getMessageBuilderFactory()); } this.messageConverter.setBeanFactory(this.getBeanFactory()); } this.initialized = true; }
@Override public void setBeanFactory(BeanFactory beanFactory) throws BeansException { this.beanFactory = beanFactory; this.messagingTemplate.setBeanFactory(beanFactory); }
/** * Obtain a {@link MessagingTemplate} with its default destination set to the input channel * of the {@link IntegrationFlow}. * <p> Any {@link IntegrationFlow} bean (not only manually registered) can be used for this method. * <p> If {@link IntegrationFlow} doesn't start with the {@link MessageChannel}, the * {@link IllegalStateException} is thrown. * @return the {@link MessagingTemplate} instance */ @Override public MessagingTemplate getMessagingTemplate() { if (this.messagingTemplate == null) { this.messagingTemplate = new MessagingTemplate(getInputChannel()) { @Override public Message<?> receive() { return receiveAndConvert(Message.class); } @Override public <T> T receiveAndConvert(Class<T> targetClass) { throw new UnsupportedOperationException("The 'receive()/receiveAndConvert()' " + "isn't supported on the 'IntegrationFlow' input channel."); } }; this.messagingTemplate.setBeanFactory(this.beanFactory); } return this.messagingTemplate; }
/** * Obtain a {@link MessagingTemplate} with its default destination set to the input channel * of the {@link IntegrationFlow}. * <p> Any {@link IntegrationFlow} bean (not only manually registered) can be used for this method. * <p> If {@link IntegrationFlow} doesn't start with the {@link MessageChannel}, the * {@link IllegalStateException} is thrown. * @return the {@link MessagingTemplate} instance */ public MessagingTemplate getMessagingTemplate() { if (this.messagingTemplate == null) { synchronized (this) { if (this.messagingTemplate == null) { this.messagingTemplate = new MessagingTemplate(getInputChannel()) { @Override public Message<?> receive() { return receiveAndConvert(Message.class); } @Override public <T> T receiveAndConvert(Class<T> targetClass) { throw new UnsupportedOperationException("The 'receive()/receiveAndConvert()' " + "isn't supported on the 'IntegrationFlow' input channel."); } }; this.messagingTemplate.setBeanFactory(this.beanFactory); } } } return this.messagingTemplate; }
/** * Obtain a {@link MessagingTemplate} with its default destination set to the input channel * of the {@link IntegrationFlow}. * <p> Any {@link IntegrationFlow} bean (not only manually registered) can be used for this method. * <p> If {@link IntegrationFlow} doesn't start with the {@link MessageChannel}, the * {@link IllegalStateException} is thrown. * @return the {@link MessagingTemplate} instance */ public MessagingTemplate getMessagingTemplate() { if (this.messagingTemplate == null) { synchronized (this) { if (this.messagingTemplate == null) { this.messagingTemplate = new MessagingTemplate(getInputChannel()) { @Override public Message<?> receive() { return receiveAndConvert(Message.class); } @Override public <T> T receiveAndConvert(Class<T> targetClass) { throw new UnsupportedOperationException("The 'receive()/receiveAndConvert()' " + "isn't supported on the 'IntegrationFlow' input channel."); } }; this.messagingTemplate.setBeanFactory(this.beanFactory); } } } return this.messagingTemplate; }
@Override protected void onInit() { Assert.notNull(this.source, "source must not be null"); Assert.state((this.outputChannelName == null && this.outputChannel != null) || (this.outputChannelName != null && this.outputChannel == null), "One and only one of 'outputChannelName' or 'outputChannel' is required."); super.onInit(); if (this.getBeanFactory() != null) { this.messagingTemplate.setBeanFactory(this.getBeanFactory()); } }
@Override protected void onInit() { super.onInit(); Assert.state(!(this.defaultOutputChannelName != null && this.defaultOutputChannel != null), "'defaultOutputChannelName' and 'defaultOutputChannel' are mutually exclusive."); if (this.getBeanFactory() != null) { this.messagingTemplate.setBeanFactory(this.getBeanFactory()); } }
@Override protected void onInit() { super.onInit(); if (this.getBeanFactory() != null) { this.messagingTemplate.setBeanFactory(this.getBeanFactory()); } }
@Override protected void onInit() { super.onInit(); Assert.state(!(this.outputChannelName != null && this.outputChannel != null), //NOSONAR (inconsistent sync) "'outputChannelName' and 'outputChannel' are mutually exclusive."); if (getBeanFactory() != null) { this.messagingTemplate.setBeanFactory(getBeanFactory()); } this.messagingTemplate.setDestinationResolver(getChannelResolver()); }
@Override protected void onInit() { try { super.onInit(); } catch (Exception e) { throw new BeanInitializationException("Cannot initialize: " + this, e); } if (this.getBeanFactory() != null) { this.messagingTemplate.setBeanFactory(this.getBeanFactory()); } }
@Override protected void onInit() { Assert.state(!(this.requestChannelName != null && this.requestChannel != null), "'requestChannelName' and 'requestChannel' are mutually exclusive."); Assert.state(!(this.replyChannelName != null && this.replyChannel != null), "'replyChannelName' and 'replyChannel' are mutually exclusive."); Assert.state(!(this.errorChannelName != null && this.errorChannel != null), "'errorChannelName' and 'errorChannel' are mutually exclusive."); this.historyWritingPostProcessor.setTrackableComponent(this); this.historyWritingPostProcessor.setMessageBuilderFactory(this.getMessageBuilderFactory()); if (this.getBeanFactory() != null) { this.messagingTemplate.setBeanFactory(this.getBeanFactory()); if (this.requestMapper instanceof DefaultRequestMapper) { ((DefaultRequestMapper) this.requestMapper).setMessageBuilderFactory(this.getMessageBuilderFactory()); } this.messageConverter.setBeanFactory(this.getBeanFactory()); } this.initialized = true; }