Refreshing all active applications
Hi all,
I'm a bit stuck with the following problem. I use the application scope to store a rather large collection of labels used in our corporate Intranet. From time to time, I need to refresh this collection as I add new labels. I implemented a refresh switch by writing the following code in my OnRequestStart method of the Application.cfc :
if (IsDefined("URL.flush"))
OnApplicationStart(flushed=true);
So on any given page I manually add the 'flush=true' URL parameters and voila, refreshed.
The problem is that different applications exist as people log onto the Intranet via different names (serverName, server IP, DNS alias,...).
I wrote the following to retrieve all active applications :
appObj = createObject("java", "coldfusion.runtime.ApplicationScopeTracker");
apps = appObj.getApplicationKeys();
appsList = "";
while (apps.hasMoreElements()) {
appName = apps.nextElement().toString();
appsList = ListAppend(appsList, appName);
}
appsList = listSort(appsList, "textNoCase", "asc");
This returns a list of all active applications. I can retrieve a specific application by calling :
appScope = appObj.getApplicationScope(appName);
However, I would like to invoke the OnApplicationStart method of each of those application scopes...
How can this be achieved?
Thanks for reading so far !
Greetings, Bert.
