Renamed PollableFileSource to FileReadingMessageSource.
This commit is contained in:
@@ -23,7 +23,7 @@ import java.util.concurrent.LinkedBlockingQueue;
|
||||
/**
|
||||
* {@link FileListFilter} that passes files only one time. This can
|
||||
* conveniently be used to prevent duplication of files, as is done in
|
||||
* {@link PollableFileSource}.
|
||||
* {@link FileReadingMessageSource}.
|
||||
*
|
||||
* @author Iwein Fuld
|
||||
*/
|
||||
|
||||
@@ -52,9 +52,9 @@ import org.springframework.util.Assert;
|
||||
*
|
||||
* @author Iwein Fuld
|
||||
*/
|
||||
public class PollableFileSource implements MessageSource<File>, MessageDeliveryAware<File> {
|
||||
public class FileReadingMessageSource implements MessageSource<File>, MessageDeliveryAware<File> {
|
||||
|
||||
private static final Log logger = LogFactory.getLog(PollableFileSource.class);
|
||||
private static final Log logger = LogFactory.getLog(FileReadingMessageSource.class);
|
||||
|
||||
private volatile File inputDirectory;
|
||||
|
||||
@@ -27,7 +27,7 @@ import org.springframework.integration.config.xml.AbstractPollingInboundChannelA
|
||||
import org.springframework.integration.file.AcceptOnceFileListFilter;
|
||||
import org.springframework.integration.file.CompositeFileListFilter;
|
||||
import org.springframework.integration.file.PatternMatchingFileListFilter;
|
||||
import org.springframework.integration.file.PollableFileSource;
|
||||
import org.springframework.integration.file.FileReadingMessageSource;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
@@ -41,7 +41,7 @@ public class FileInboundChannelAdapterParser extends AbstractPollingInboundChann
|
||||
|
||||
@Override
|
||||
protected String parseSource(Element element, ParserContext parserContext) {
|
||||
BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(PollableFileSource.class);
|
||||
BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(FileReadingMessageSource.class);
|
||||
String directory = element.getAttribute("directory");
|
||||
if (StringUtils.hasText(directory)) {
|
||||
builder.addPropertyValue("inputDirectory", directory);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd">
|
||||
|
||||
<!-- under test -->
|
||||
<bean id="pollableFileSource" class="org.springframework.integration.file.PollableFileSource"
|
||||
<bean id="pollableFileSource" class="org.springframework.integration.file.FileReadingMessageSource"
|
||||
p:inputDirectory="file:${java.io.tmpdir}/PollableFileSourceIntegrationTests"
|
||||
p:filter-ref="compositeFilter"/>
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
public class PollableFileSourceIntegrationTests {
|
||||
|
||||
@Autowired
|
||||
PollableFileSource pollableFileSource;
|
||||
FileReadingMessageSource pollableFileSource;
|
||||
|
||||
private static File inputDir;
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ import org.springframework.integration.core.Message;
|
||||
@SuppressWarnings("unchecked")
|
||||
public class PollableFileSourceTests {
|
||||
|
||||
private PollableFileSource pollableFileSource;
|
||||
private FileReadingMessageSource pollableFileSource;
|
||||
|
||||
private File inputDirectoryMock = createMock(File.class);
|
||||
|
||||
@@ -53,7 +53,7 @@ public class PollableFileSourceTests {
|
||||
@Before
|
||||
public void initialize() throws Exception {
|
||||
prepResource();
|
||||
this.pollableFileSource = new PollableFileSource();
|
||||
this.pollableFileSource = new FileReadingMessageSource();
|
||||
pollableFileSource.setInputDirectory(inputDirectoryResourceMock);
|
||||
reset(allMocks);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ import org.springframework.beans.DirectFieldAccessor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.integration.core.MessageChannel;
|
||||
import org.springframework.integration.file.CompositeFileListFilter;
|
||||
import org.springframework.integration.file.PollableFileSource;
|
||||
import org.springframework.integration.file.FileReadingMessageSource;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
@@ -43,7 +43,7 @@ public class FileInboundChannelAdapterParserTests {
|
||||
MessageChannel channel;
|
||||
|
||||
@Autowired(required=true)
|
||||
PollableFileSource source;
|
||||
FileReadingMessageSource source;
|
||||
|
||||
DirectFieldAccessor accessor;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user