On 3/1/06, Dave Shuck <[EMAIL PROTECTED]> wrote:
> <cfparam
> name="application.#arguments.name#Gateway"
> default=#evaluate("Reactor.createGateway(""" & arguments.name & """)")# />
>
> <cfreturn evaluate("application." & arguments.name & "Gateway") />
Yikes!!! What's with the evaluate() calls???
<cfparam name="application.#arguments.name#Gateway"
default="#reactor.createGateway(arguments.name)#" />
<cfreturn application[arguments.name & "Gateway"] />
However, <cfparam> evaluates its default= value *every* time so you'll
be creating a new Reactor gateway each time through this code - even
tho' you only store the first one. <cfparam> is not really a good way
to set application scope variables (for this reason).
<cfif not structKeyExists(application,arguments.name & "Gateway")>
<cflock name="#application.applicationname#_#arguments.name#Gateway"
type="exclusive" timeout="30">
<cfif not structKeyExists(application,arguments.name & "Gateway")>
<cfset application[arguments.name & "Gateway"] =
Reactor.createGateway(arguments.name) />
</cfif>
</cflock>
</cfif>
Hope that helps.
--
Sean A Corfield -- http://corfield.org/
Got frameworks?
"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood
-- Reactor for ColdFusion Mailing List -- [email protected]
-- Archives at http://www.mail-archive.com/reactor%40doughughes.net/