Versions Compared

Key

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

...

  1. setId - takes the spring:id=jbi and sets the id of the container to "jbi"
  2. setcomponentName - sets componentName to httpReceiver on first invocation and "stockQuote" in the next
  3. setEndpoint - sets the endpoint properties from the servicemix.xml file
  4. setService - sets the service properties from xml file
  5. setDestinationService = sets the destinationService for each component

HttpConnector Details

  1. The ServiceMix container reads the servicemix.xml file and sees it needs to instantiate a HttpConnector.
  2. The container calls the init() method of HttpConnector. The init() method sets the host and port property of the SocketListener in which the HttpConnector will liten message to.
  3. The container determines that HttpConnector is an MBean and, therefore, calls the start() method of HttpConnector.
  4. The start() method will:
    A. Create a timerTask.
    B. Schedule the timerTask at a fixed rate. 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 of 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. timerTask's run method() is defined inline. This run() method will get the workManager object (see below for details).
    D. The workManager will call "scheduleWork(PollingComponentSupport.this)". Note: it passes in PollingComponent support, which by virtue of its inheritance hierarchy, is of type "Work", which is a "Runnable" object.
    E. "workManager.scheduleWork(Work)" will get a Thread, passing in a Runnable object, i.e. PollingComponentSupport, and call its run() method.
    F. PollingComponent's run() method calls poll(), which is implemented in FilePoller.
    G. From this point on the call sequence can be followed in FilePoller...
    H. The start() method of PollingComponentSupport, will eventually call super.start(), which propagates up to call the start() method of BaseLifeCycle, which sets the component state to "RUNNING."

stockQuote Details

Related Documentation

...