Runs when an application times out or the server is shutting down.
<cffunction name="onApplicationEnd" returnType="void"> <cfargument name="ApplicationScope" required=true/> ... </cffunction>
onApplicationStart, Method summary, "Managing the application with Application.cfc" in the ColdFusion Developer's Guide
ColdFusion passes the following parameters to the method:
Parameters |
Description |
---|---|
ApplicationScope |
The application scope. |
This method does not return a value; do not use the cfreturn tag.
Use this method for any clean-up activities that your application requires when it shuts down, such as saving data in memory to a database, or to log the application end to a file. You cannot use this method to display data on a user page, because it is not associated with a request. The application ends, even if this method throws an exception.
If you call this method explicitly, ColdFusion does not end the application; it does execute the method code, but does not lock the Application scope while the method executes.
You must use the ApplicationScope
parameter to access the application scope; you cannot reference the scope directly; for example, use Arguments.ApplicationScope.myVariable, not Application.myVariable. This method can access the Server scope directly, but it does not have access to Session or Request scopes.
<cffunction name="onApplicationEnd"> <cfargument name="ApplicationScope" required=true/> <cflog file="#This.Name#" type="Information" text="Application #Arguments.ApplicationScope.applicationname# Ended" > </cffunction>