root / framework / trunk / extensions / lexicon / reactor / initialize.cfm

Revision 275, 1.1 kB (checked in by scorfield, 2 years ago)

Nathan Strutz wrote this lexicon.

  • Property svn:executable set to *
Line 
1<cfscript>
2        // @ Author Nathan Strutz
3        // Initializes a Reactor factory into the current application scope (respecting the fusebox application key)
4        // usage:
5        // 1. add the lexicon declaration to your circuit file:
6        //    <circuit xmlns:reactor="reactor/">
7        // 2. use the verb in a fuseaction:
8        //    <reactor:initialize configuration="#expandPath('/config/Reactor.xml')#"/>
9        //
10        if (fb_.verbInfo.executionMode is "start") {
11
12                // beanDefinitionFile is required
13                if (not structKeyExists(fb_.verbInfo.attributes,"configuration")) {
14                        fb_throw("fusebox.badGrammar.requiredAttributeMissing",
15                                                "Required attribute is missing",
16                                                "The attribute 'configuration' is required, for a 'initialize' verb in fuseaction #fb_.verbInfo.circuit#.#fb_.verbInfo.fuseaction#.");
17                }
18                //
19
20                // set ColdSpring in this fusebox instance's application space
21                fb_appendLine('<cfset myFusebox.getApplication().getApplicationData().reactor = createObject("component", "reactor.reactorFactory").init("#fb_.verbInfo.attributes.configuration#") />');
22        } else {
23                //
24                // end mode - do nothing
25        }
26</cfscript>
Note: See TracBrowser for help on using the browser.