Welcome to WebProNews Breaking eBusiness and Search News
Advertise | Newsletter | Sitemap | News Feeds News Feed 
 WebProNews Search Part of the iEntry network iEntry inc. 

Getting A List Of Application Names In ColdFusion

Raymond Camden
Expert Author
Published: 2007-12-21

WebProNews RSS Feed


Andy asks:

Is there a way to get a list of application names from all of the Application.cfc running on a server. I'm trying to dynamically build a server.applicationNameArray by just dropping a web app into the web tree. Thanks for your time.
Technically the answer to this is no, but there are two ways of doing this. The first way is to use the SeverMonitor API. There isn't a 'get a list of application names', but there is a method named getAllApplicationScopesMemoryUsed. This method returns the memory used by all application scopes on your server. The keys of the structure are your application names. Here is an example:

<cfset password = "poorspearsfamily">
<cfinvoke component="CFIDE.adminapi.administrator" method="login" adminpassword="#password#" returnVariable="result">

<cfinvoke component="CFIDE.adminapi.servermonitoring" method="getAllApplicationScopesMemoryUsed" returnVariable="ascopes">
<cfdump var="#ascopes#">


By the way, check out the memory usage for the model-glue app:

The Model-Glue app is the one in red. Model-Glue is so good it gives your server RAM. Yeah, that's it.

So the second solution is a bit of an hack, but has been around for a while. If you define an application w/o a name, the Application scope for that unnamed application will contain a bunch of junk, including a pointer to all the applications on your server. Consider this code:

<cfapplication>
<cfloop item="k" collection="#application#">
   <cfif isStruct(application[k]) and structKeyExists(application[k], "applicationname")>
    <cfdump var="#application[k]#" label="#k#">
   </cfif>
</cfloop>


This will dump each Application and all it's variables. Note the CFIF and how I check to see if the variable is an application scope. Not perfect, but in my test with both code blocks, it returned the same thing. (Well, the second code block didn't show the blank key for the unnamed application scope like the first one did.)

Comments

View All Articles by Raymond Camden



Receive Our Daily Email of Breaking eBusiness News


About the Author:
Raymond Camden, ray@camdenfamily.com
http://ray.camdenfamily.com

Raymond Camden is Vice President of Technology for roundpeg, Inc. A long time ColdFusion user, Raymond has worked on numerous ColdFusion books and is the creator of many of the most popular ColdFusion community web sites. He is an Adobe Community Expert, user group manager, and the proud father of three little bundles of joy.

WebProNews RSS Feed

More Expert Articles Articles

Contact WebProNews
Advertisement





TOP NEWS

WebProBlog
The official blog of WebProNews.

Go to WebProBlog

Targeted Information for Business
WebProNews is part of the iEntry network

Internet Business: Marketing: Small Business:
WebProNews MarketingNewz SmallBusinessNewz
WebProWorld AdvertisingDay PromoteNews
EcommNewz SalesNewz EntrepreneurNewz

Software: Search Engines: Web Design:
WebMasterFree Jayde B2B DesignNewz
NetworkingFiles SearchZA FlashNewz
SecurityConfig SearchNewz WebSiteNotes

Developer: IT Management: Security:
DevWebPro ITManagement SecurityProNews
DevNewz SysAdminNews SecurityConfig
TheDevWeb NetworkingFiles NetworkNewz

The iEntry Network consists of over 100 web publications reaching millions of Internet Professionals. Contact us to advertise.
eBUSINESS RESOURCES






 Advertise | Contact Us | Corporate | Newsletter | Sitemap | Submit an Article | News Feeds
 WebProNews is an iEntry, Inc. ® publication - $line) { echo $line ; } ?> All Rights Reserved
WebProWorld
Ten most recent posts.


SearchBrains.com
NetworkingFiles
Featured Software


About WebProNews
WebProNews is the number one source for eBusiness News. Over 5 million eBusiness professionals read WebProNews and other iEntry business and tech publications.

WebProNews provides real-time coverage of internet business.

Free Email Newsletters:
WebProNews SearchNewz
WebProWorld DevWebPro
Marketing SecurityNews
Plus over 100 other newsletters!

Send me relevant info on products and services.


iEntry.com WebProWorld RSS Feed WebProWorld Contact WebProNews Print Version Email a friend Bookmark us SearchBrains.com SearchBrains RSS Feed