uk.ac.bbsrc.tgac.miso.notification.core
Modified from the source below to provide a list of files as a result, rather than polling single files sequentially from the queue
@author Rob Davey
@date 08-Dec-2010
@since 0.0.2-------------------------------- {@link org.springframework.integration.core.MessageSource} that creates messages from a file system directory. Toprevent messages for certain files, you may supply a {@link org.springframework.integration.file.filters.FileListFilter}. By default, an {@link org.springframework.integration.file.filters.AcceptOnceFileListFilter}is used. It ensures files are picked up only once from the directory.
A common problem with reading files is that a file may be detected before it is ready. The default {@link org.springframework.integration.file.filters.AcceptOnceFileListFilter}does not prevent this. In most cases, this can be prevented if the file-writing process renames each file as soon as it is ready for reading. A pattern-matching filter that accepts only files that are ready (e.g. based on a known suffix), composed with the default {@link org.springframework.integration.file.filters.AcceptOnceFileListFilter}would allow for this.
A {@link java.util.Comparator} can be used to ensure internal ordering of the Files ina {@link java.util.concurrent.PriorityBlockingQueue}. This does not provide the same guarantees as a {@link org.springframework.integration.aggregator.ResequencingMessageGroupProcessor}, but in cases where writing files and failure downstream are rare it might be sufficient.
FileReadingMessageSource is fully thread-safe under concurrent
receive()
invocations and message delivery callbacks.
@author Iwein Fuld
@author Mark Fisher
@author Oleg Zhurakousky