Versions Compared

Key

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

...

  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 timerTaskSets the listener property of the server.
    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."Creates a new HttpContext that contains a ServletHandler class. ServletHandler maps requests to servlets that implement the javax.servlet.http.HttpServlet API. In this case it sends request to BindingServlet.
    C. Server is started.

stockQuote Details

Related Documentation

...