Jul 21
Mike Schierberl just posted a great example on why to user varScoper. It's a must read for those who have not fully understood the reasoning behind var scoping.
You can catch the post here:
http://www.schierberl.com/cfblog/index.cfm/2008/7/21/Thread-safety-and-the-var-scope--live-example
Jul 21
A little while back I created a small app that shows how you can use Spry Datasets with Mach-II. Since then I have made a few modifications to help show ways you can use other frameworks within the app (ColdSpring is used within this example). I strongly suggest reviewing Chris Scott's example on AOP in ColdSpring if you need to know more about that subject.
I've updated my original example to use/do the following:
- ColdSpring to hold the gateway/DAO/Factory being used now.
- ColdSpring AOP is enabled to show simple logging capabilities
- An optional ColdSpring service injector using its built in createBeanDefinition method:
- found within lib.com.machii.listeners.BaseListener
- can be turned on from within the MessageListener (lib.com.machii.MessageListener) Line# 38
NOTE: Turning this on will keep AOP functionality from working as my current code does not support working with AOP dynamically when working with createBeanDefinition
Read more...
Jul 21
Recently I have started to assist on a project that is meant to talk to Cold Fusion 8’s adminAPI to help with environment setups. One main task I have in front of me is to update setting within administrator through such methods as setRuntimeProperty and setCacheProperty.
My issue has been that I have not yet found a good list of property names that the above methods need in order to work. So I started to dig and found the below property names. For those who use these method and know of other lists please feel free to post their locations as I would be more than interested to reviewing them.
I’ve broken them down by section and “friendly” location within cf administrator.
CF ADMINISTRATOR SECTION: SERVER SETTINGS – Settings
- [{timeoutRequests}] Timeout Requests after (seconds) [{timeoutRequestTimeLimit}]
- [{enablePerAppSettings}] Enable Per App Settings
- [{uuidcftoken}] Use UUID for cftoken
- [{HttpStatusCodes}] Enable HTTP status codes
- [{whitespace}] Enable Whitespace Management
- [{cfcTypeCheck}] Disable CFC Type Check
- [{disableServiceFactory}] Disable access to internal ColdFusion Java components
- [{secureJSON}] Prefix serializedf JSON with [{secureJSONPrefix}]
- [{globalScriptProtect}] Enable Global Script Protection
- Default ScriptSrc Directory [{CFFORMScriptSrc}]
- Missing Template Handler [{MissingTemplateHandler}]
- Site-wide Error Handler [{SiteWideErrorHandler}]
- Maximum size of post data [{postSizeLimit}] MB
- Request Throttle Threshold [{requestThrottleThreshold}] MB
- Request Throttle Memory [{requestThrottleMemory}] MB
CF ADMINISTRATOR SECTION: SERVER SETTINGS – Request Tuning
- Maximum number of simultaneous Template requests [{requestLimit}]
- Maximum number of simultaneous Flash Remoting requests [{flashRemotingLimit}]
- Maximum number of simultaneous Web Service requests [{webserviceLimit}]
- Maximum number of simultaneous CFC function requests [{CFCLimit}]
- Maximum number of running JRun threads [{JRunActiveHandlerThreads}]Maximum number of queued JRun Threads [{JRunMaxHandlerThreads}]
- Maximum number of simultaneous Report threads [{ReportThread}]
- Maximum number of threads available for CFTHREAD [{CFThreadLimit}]
- Timeout requests waiting in queue after [{requestQueueTimeout}] seconds
- Request Queue Timeout Page [{requestQueueTimeoutPage}]
CF ADMINISTRATOR SECTION: SERVER SETTINGS – Caching
- Maximum number of cached templates [{TemplateCacheSize}]
- [{trustedCache}] Trusted cache
- [{saveClassFiles}] Save class files
- [{cacheRealPath}] Cache web service paths
- Maximum number of cached queries [{MaxCacheQuery}]
As I find more I will update them accordingly, but at least it’s a start.
May 16
A bit back Brian Szoszorek showed a wonderful example on how to use Cold Fusion's gateway functionality to help streamline the use of the Trusted Cache. This article was brought to my attention by a fellow co-worker (Mike Schierberl) and after reviewing the article in detail I was stunned on how powerful this was and how easy it was to implement. So I decided to tweak it here and there to see what else it could do.
Here are the tweaks:
- Incorporated Mike Schierberl's varScoper as an optional feature. If you update or add a cfc it will run a varScope check against it and log it into a VarScoper.log file within cold fusions log folder. Auto-watch it threw your favorite file watching tool (Example: Logwatcher for cfEclipse) and you have a realtime varScoper running telling you if there are any unscoped vars within the file you just added/updated. For varScoper fans I see this as being very nice!
- Made the clear caching method to be just a little smarter (ability to just removing specific files from the cache rather than clearing the entire cache itself)
- New method "setEventGateway" that will create the needed cfg file and gateway entries within Cold Fusion Administrator. Very Cool.. Very Powerful.. and Very Easy!
You can download the code here.
NOTES:
There seems to be a few bugs within the adminapi interface for clearing the cache. Currently when you attempt to remove a file from the cache after a file has been removed you receive an error stating it cannot remove it from the cache since the file does not exist on the server. To fix this we just clear the entire cache when a file is removed. Another bug is when you delete, then add the file back into the cache. For some reason it does not pick it up. To fix this we do clear cache call on the file being added. I'm not sure why this works, but it does. I will be posting this to Adobe to see what's up.
Here are the steps on how to implement:
1) Create a new directory that the component will live in and place the component in there
a. Example: C:\inetpub\wwwroot\templateListener
2) Set the cfpassword variable to reflect your cfpassword. This needs to be hardcoded within the component in order for the gateway to work properly.
3) Access and run the setEventGateway method provided within the component and provide it the directory you want to watch
a. Example: #createObject("component", "templateListener").setEventGateway(directoryToWatch="c:/inetpub/wwwroot")#
4) Turn on Template Caching within Cold Fusion Administrator by (CF Admin -> Server Settings -> Caching -> Trusted Cache)
5) Confirm that the Gateway Instance is running by (CF Admin -> Event Gateways -> Gateway Instances)
6) If you want to turn off the varScoper check then you can turn it off by adjusting the "runVarScoper" flag at the top of the component to false
4-13-2008
4-13-2008
4-13-2008
4-11-2008
4-11-2008