INT-3899: Defer Poller Creation Until start()

JIRA: https://jira.spring.io/browse/INT-3899

Previously, within `AbstractPollingEndpoint`, the `Poller` object was
created from `afterPropertiesSet()` as well as `start()` if previously `stopped()`
(`this.initialized == false`).

This precluded modification of the advice chain (e.g. in tests when using
`autoStartup == false`).

Move the poller creation to `start()` so that it is always created then, and does
not require a previous `stop()` to change the advice chain.
This commit is contained in:
Gary Russell
2016-01-05 14:36:44 -05:00
parent eb34d5c9e6
commit 2f56bb1329
3 changed files with 15 additions and 12 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -90,7 +90,6 @@ public class FtpInboundChannelAdapterParserTests {
assertNotNull(comparator);
assertEquals("ftpInbound", ftpInbound.getComponentName());
assertEquals("ftp:inbound-channel-adapter", ftpInbound.getComponentType());
assertNotNull(TestUtils.getPropertyValue(ftpInbound, "poller"));
assertEquals(context.getBean("ftpChannel"), TestUtils.getPropertyValue(ftpInbound, "outputChannel"));
FtpInboundFileSynchronizingMessageSource inbound =
(FtpInboundFileSynchronizingMessageSource) TestUtils.getPropertyValue(ftpInbound, "source");