...
The File Binding XML file, servicemix.xml
, contains two components and a supporting bean. One component waits for a file to be deposited into the the inbox
directory, retrieves it, sends it creates a normalized message that contains the file, then sends the message to the Normalized Message Router (NMR). The NMR routes the file to another component, which deposits it into an outbox
directory.
Info | ||
---|---|---|
| ||
The file to be transmitted from the inbox to outbox must be in XML format. |
...
Component or Bean ID | Description |
---|---|
filePoller | This component periodically checks the "inbox" directory looking for files. If there is a file or directory present, it adds the file to the "workingSet", which is a collection of files to be processed. The workManger is invoked to schedule the work of processing the file from the workingSet. Another thread is created and the processing of the file begins. Processing consists of marshalling the file (streaming it from disk into a normalized message). The normalized message is sent over the Normalized Message Router ( NMR ) to the fileSender component per the specified "destinationService" which . The destinationService is specified in the |
fileSender | This component is the "destinationService" for the filePoller. It receives normalized messages from filePoller. The messages it receives are the files that filePoller has transferred to it via the NMR. It converts the normalized message to its original file format and sends it to the destination directory, in this case the |
workManager | This bean is used by the filePoller to increase the throughput of the application. The workManager is a thread pool whose size can be adjusted declaratively in the |
...
- The timerTask uses threads from the thread pool to periodically check the
inbox
directoroy for files. - The workManager will also allocate a thread to process a file (read, normalize and send to NMR). The workManager calls a scheduleWork() method which is non-blocking. Therefore, if multiple files need to be processed, ilePoller can continue making requests to the workManager to schedule work.
Summarizing, when the ServiceMix container instantiates an MBean it firsts sets the property values if there are any, then calls the init() method of the class and its' parent classes, if applicable. Then it calls the start() method of the class.
Related Documentation
For more information on the following topics please see:
...