| | 1 | = Application.cfc Integration with MG3 = |
| | 2 | |
| | 3 | You can add listeners: |
| | 4 | {{{ |
| | 5 | <message-listener message="onApplicationStart(SessionStart/SessionEnd" function=".." /> |
| | 6 | }}} |
| | 7 | |
| | 8 | http://localhost:8500/modelgluesamples/applicationcfc/ |
| | 9 | |
| | 10 | I'm an example of using the new "onApplicationStart", "onSessionStart", and "onSessionEnd" broadcasts. |
| | 11 | |
| | 12 | According to its controller, this app has 1 active session. If you open a second type of browser or browse from another computer, you should see this number go up when you reload. |
| | 13 | |
| | 14 | To listen for any of these events, just add a message listener tag to any of your controllers: |
| | 15 | {{{ |
| | 16 | <controller id="Controller" type="modelgluesamples/applicationcfc.controller.Controller"> |
| | 17 | <message-listener message="onApplicationStart" function="onApplicationStart" /> |
| | 18 | <message-listener message="onRequestStart" function="getSessionCount" /> |
| | 19 | <message-listener message="onSessionStart" function="onSessionStart" /> |
| | 20 | <message-listener message="onSessionEnd" function="onSessionEnd" /> |
| | 21 | </controller> |
| | 22 | }}} |
| | 23 | Like any other message broadcast, you can have as many listener functions as you desire. |