I came across this while trying to work out a way of easily clearing the Trusted Cache on a few servers without having to login to each one.

First you need to grab the object and set it up the same way CF Admin does.


<cfobject action="CREATE"
  type="JAVA"
  class="coldfusion.server.ServiceFactory"
  name="factory">
      
<cflock name="cfadmin_runtime" timeout="20">
<cftry>
	<cfset request.runtime = factory.getRuntimeService()>
		<cfcatch type="Any">
			<cfset request.runtime = StructNew()>
		</cfcatch>
</cftry>
</cflock>

Then to check the status of Trusted Cache you can do this:

<cfoutput>
    #request.runtime.isTrustedCache()#
</cfoutput>

And to set the value you do this (where value is either true or false):

<cfscript>
    request.runtime.setTrustedCache(value);
</cfscript>
About This Tutorial
Author: Nick Le Mouton
Skill Level: Intermediate 
 
 
 
Platforms Tested: CFMX
Total Views: 38,784
Submission Date: December 23, 2005
Last Update Date: June 05, 2009
All Tutorials By This Autor: 1
Discuss This Tutorial
Advertisement

Sponsored By...
Powered By...