Changeset 1769
- Timestamp:
- 10/14/08 15:58:36 (5 years ago)
- Files:
-
- 1 modified
-
coldbox/trunk/system/plugins/ioc.cfc (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
coldbox/trunk/system/plugins/ioc.cfc
r1736 r1769 35 35 setpluginDescription("This is an inversion of control plugin."); 36 36 37 /* Local Properties */38 39 37 /* Setup the framework chosen in the config */ 40 38 setIOCFramework( getSetting("IOCFramework") ); … … 59 57 setLIGHTWIRE_FACTORY( getSetting("LightWireBeanFactory",true) ); 60 58 } 61 59 62 60 /* Return instance. */ 63 61 return this; … … 110 108 <cfargument name="beanName" type="string" required="true" hint="The bean name to retrieve from the object factory"> 111 109 <!--- ************************************************************* ---> 112 <cfset var oBean = "">110 <cfset var oBean = 0> 113 111 <cfset var beanKey = "ioc_" & arguments.beanName> 114 112 <cfset var MetaData = structNew()> … … 119 117 <cfset oBean = getColdBoxOCM().get(beanKey)> 120 118 <cfelse> 121 122 119 <!--- Get Bean from IOC Framework ---> 123 120 <cfif lcase(getIOCFramework()) eq "coldspring"> … … 126 123 <cfset oBean = getIoCFactory().getBean(arguments.beanName)> 127 124 </cfif> 125 126 <!--- Autowire Support ---> 127 <cfset getPlugin("beanFactory").autowire(target=oBean,annotationCheck=true)> 128 128 129 129 <!--- If Caching on, then set object in cache ---> … … 146 146 <cfset MetaData.cacheLastAccessTimeout = ""> 147 147 </cfif> 148 148 <!--- Cache the object ---> 149 149 <cflock name="ioc.objectCaching.#arguments.beanName#" type="exclusive" timeout="30" throwontimeout="true"> 150 <!--- Cache the object --->151 150 <cfset getColdboxOCM().set(beanKey,oBean,metadata.cacheTimeout,metadata.cacheLastAccessTimeout)> 152 151 </cflock> 153 152 </cfif> 154 </cfif> 155 153 </cfif> 156 154 </cfif> 157 155
