ColdBox Application Life Cycle

ColdBox is based on the MVC design pattern shown below. You will also so in continuation the request lifecycle of a typical ColdBox request and a typical ColdBox proxy request.

The Request Lifecycle

This section describes how the framework executes an incoming request. This will give you a roadmap of where you would like to place interceptors, module calls, security, etc.

For each request, the following cycle occurs:

  1. Is the framework initialized?
    1. False: Initialize framework (Creates controller, internal structures, and prepares for requests) then Goto step 4.
    2. True : Goto step 4
  2. Is the config auto reload flag set to true?
    1. True : Initialize Framework then Goto step 4
    2. False : Goto step 4
  3. Is the handler index auto reload flag set to true?
    1. True : Register handlers index then Goto step 4
    2. False : Goto step 4
  4. Capture Request and create request context
  5. Does the Application Start Handler exist and has it not fired yet?
    1. True : Execute Application Start Handler then Goto step 6
    2. False : Goto step 6
  6. Execute the preProcess Interceptors
  7. Execute the Request Start Handler if it exists
  8. Is the incoming event cached?
    1. True : Retrieve event cache and render, then Goto step 19.
    2. False : Continue
  9. Execute the preEvent Interceptors
  10. Execute the handler.preHandler() event if it exists
  11. Execute the handler.event()
  12. Execute the handler.postHandler() event if it exists
  13. Execute the postEvent Interceptors
  14. Execute the Request End Handler if it exists
  15. Execute the preView Interceptors
  16. Render the View/Layout Combinations
  17. Execute the postView Interceptors
  18. Execute the postProcess Interceptors
  19. Are we in debug mode?
    1. True : Render the debugging panel
  20. END

The ColdBox Proxy Lifecycle

For a ColdBox Proxy request, the following cycle occurs:

  1. Is the framework initialized?
    1. False: Initialize framework (Creates controller, internal structures, and prepares for requests) then Goto step 4.
    2. True : Goto step 4
  2. Is the config auto reload flag set to true?
    1. True : Initialize Framework then Goto step 4
    2. False : Goto step 4
  3. Is the handler index auto reload flag set to true?
    1. True : Register handlers index then Goto step 4
    2. False : Goto step 4
  4. Capture Request and create request context according to passed in proxy parameters.
  5. Set flag in event object that this is a proxy request
  6. Does the Application Start Handler exist and has it not fired yet?
    1. True : Execute Application Start Handler then Goto next step
    2. False : Goto next step
  7. Execute the preProcess Interceptors
  8. Execute the Request Start Handler if it exists
  9. Execute the preEvent Interceptors
  10. Execute the handler.preHandler() event if it exists
  11. Execute the handler.event()
  12. Execute the handler.postHandler() event if it exists
  13. Execute the postEvent Interceptors
  14. Determine if returning the request collection or the return variables from the executed event.
    1. Return Request Collection structure or
    2. Return Event Results

Copyright 2006 ColdBox Framework by Luis Majano