Source:
private void initializeAdapter() { synchronized (this.initializationMonitor) { if (this.initialized) { return; } Assert.notNull(this.source, "source is required"); Assert.notNull(this.outputChannel, "outputChannel is required"); SourcePollingChannelAdapter spca = new SourcePollingChannelAdapter(); spca.setSource(this.source); if (StringUtils.hasText(this.outputChannelName)) { Assert.isNull(this.outputChannel, "'outputChannelName' and 'outputChannel' are mutually exclusive."); this.outputChannel = this.beanFactory.getBean(this.outputChannelName, MessageChannel.class); } spca.setOutputChannel(this.outputChannel); if (this.pollerMetadata == null) { this.pollerMetadata = PollerMetadata.getDefaultPollerMetadata(this.beanFactory); Assert.notNull(this.pollerMetadata, "No poller has been defined for channel-adapter '" + this.beanName + "', and no default poller is available within the context."); } if (this.pollerMetadata.getMaxMessagesPerPoll() == Integer.MIN_VALUE){ this.pollerMetadata.setMaxMessagesPerPoll(1); } spca.setMaxMessagesPerPoll(this.pollerMetadata.getMaxMessagesPerPoll()); if (this.sendTimeout != null){ spca.setSendTimeout(this.sendTimeout); } spca.setTaskExecutor(this.pollerMetadata.getTaskExecutor()); spca.setAdviceChain(this.pollerMetadata.getAdviceChain()); spca.setTrigger(this.pollerMetadata.getTrigger()); spca.setErrorHandler(this.pollerMetadata.getErrorHandler()); spca.setBeanClassLoader(this.beanClassLoader); spca.setAutoStartup(this.autoStartup); spca.setPhase(this.phase); spca.setBeanName(this.beanName); spca.setBeanFactory(this.beanFactory); spca.setTransactionSynchronizationFactory(this.pollerMetadata.getTransactionSynchronizationFactory()); spca.afterPropertiesSet(); this.adapter = spca; this.initialized = true; } }

Target:
private void initializeAdapter() { synchronized (this.initializationMonitor) { if (this.initialized) { return; } Assert.notNull(this.source, "source is required"); if (StringUtils.hasText(this.outputChannelName)) { Assert.isNull(this.outputChannel, "'outputChannelName' and 'outputChannel' are mutually exclusive."); try { this.outputChannel = this.beanFactory.getBean(this.outputChannelName, MessageChannel.class); } catch (BeansException e) { throw new DestinationResolutionException("Failed to look up MessageChannel with name '" + this.outputChannelName + "' in the BeanFactory."); } } Assert.notNull(this.outputChannel, "outputChannel is required"); SourcePollingChannelAdapter spca = new SourcePollingChannelAdapter(); spca.setSource(this.source); spca.setOutputChannel(this.outputChannel); if (this.pollerMetadata == null) { this.pollerMetadata = PollerMetadata.getDefaultPollerMetadata(this.beanFactory); Assert.notNull(this.pollerMetadata, "No poller has been defined for channel-adapter '" + this.beanName + "', and no default poller is available within the context."); } if (this.pollerMetadata.getMaxMessagesPerPoll() == Integer.MIN_VALUE){ this.pollerMetadata.setMaxMessagesPerPoll(1); } spca.setMaxMessagesPerPoll(this.pollerMetadata.getMaxMessagesPerPoll()); if (this.sendTimeout != null){ spca.setSendTimeout(this.sendTimeout); } spca.setTaskExecutor(this.pollerMetadata.getTaskExecutor()); spca.setAdviceChain(this.pollerMetadata.getAdviceChain()); spca.setTrigger(this.pollerMetadata.getTrigger()); spca.setErrorHandler(this.pollerMetadata.getErrorHandler()); spca.setBeanClassLoader(this.beanClassLoader); spca.setAutoStartup(this.autoStartup); spca.setPhase(this.phase); spca.setBeanName(this.beanName); spca.setBeanFactory(this.beanFactory); spca.setTransactionSynchronizationFactory(this.pollerMetadata.getTransactionSynchronizationFactory()); spca.afterPropertiesSet(); this.adapter = spca; this.initialized = true; } }