Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info
titleNote

The file to be transmitted from the inbox directory to outbox must be in XML format.

Running the File Binding Example

...

  1. The ServiceMix container reads the servicemix.xml file and sees it needs to instantiate a FilePoller.
  2. The container calls the init() method of FilePoller as well as the init() methods of its parents
  3. The container determines that FilePoller is an MBean and, therefore, calls the start() method of FilePoller, which it inherits from its parent PollingComponentSupport.
  4. The start() method will:
    a. Create a timerTask, which overrides the run() method inline, the run() method will eventually get the WorkManager and schedule work.
    b. The start() method uses the "timer" (created in the init() method) to schedule the timerTask at a fixed rate, timer.scheduleAtFixedRate(timerTask, firstTime, period. Recall "period" is a property FilePoller. It was assigned the value of 1000ms by dependency injection from the servicemix.xml file.
    c. timer will call the run() method of the timerTask periodically.
    d. timerTask's run method() is defined inline.
    e. it It will get the workManager object (see below for details).
    f. the work manager e. The workManager will call scheduleWork(PollingComponentSupport.this). note Note: it passes in PollingComponent support, which by virtual virtue of its inheritance hierarchy, is also of type "Work", which is also a "runnableRunnable."
    g f. WorkManagerworkManager.scheduleWork(Work) will likely create or get a Thread, passing in a runnableRunnable object, i.e. PollingComponentSupport, and call its " run" () method
    h g. PollingComponent's run() method calls poll(), which is implemented in filePoller FilePoller.
    i h. From this point on the call sequence can be followed in filePoller
    6 FilePoller...
    i. The start() method of PollingComponentSupport, will eventually call calls super.start(), which propagates up to call the start() method of BaseLifeCycle, which sets the component state to "RUNNING."

_workManager DetailsWORK MANAGER DETAILS

Work manager is used in two ways:

...