Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

File Adapters > Standalone File Readers

Standalone File Readers

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: receive(). This is a base interface implemented by all the sources that require polling for messages. The return value is a 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.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint