= Application.cfc Integration with Model-Glue 3 =
Model-Glue 3 has added support for new message broadcasts that can be used to emulate the behavior of the corresponding application event methods in Application.cfc: onApplicationStart, onSessionStart and onSessionEnd. These new messages are broadcast by the framework automatically, and can be used by adding the appropriate message listeners in any controller:
{{{
}}}
And then adding the corresponding message listener function(s) to the controller CFC:
{{{
}}}
As with any Model-Glue broadcast, you may add message listeners to as many controllers as you like, and they will be fired in the order in which the controllers appear in the !ModelGlue.xml file.
The onApplicationStart event is broadcast every time a Model-Glue application initializes, so it will be fired on every request if the application is in development mode.
In order to access the sessionScope structure that is supplied as an argument to the onSessionEnd event in Application.cfc, one can retrieve this value from the event argument of the message listener function:
{{{
}}}