Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
If you have chosen not to use the declarative model, then you may
choose to use Framework’s classes. The file reader is represented by the
FileReadingMessageSource class. It
implements Framework’s MessageSource
interface with one method: . This is a base interface
implemented by all the sources that require polling for messages. The
return value is a receive()Message object with
java.io.File as a payload.
The FileReadingMessageSource
can be used as a simple bean to read the files as messages. The StandaloneFileAdapterTest below shows such a
case. All you have to do is to instantiate the class and set a few
properties, such as the directory in which you can find the
files.