Changeset 2354
- Timestamp:
- 06/26/09 03:43:38 (4 years ago)
- Files:
-
- 1 modified
-
coldbox/trunk/system/cache/ObjectPool.cfc (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
coldbox/trunk/system/cache/ObjectPool.cfc
r1976 r2354 142 142 <cffunction name="set" access="public" output="false" returntype="void" hint="sets an object in cache."> 143 143 <!--- ************************************************************* ---> 144 <cfargument name="objectKey" type="any" required="true" >145 <cfargument name=" MyObject" type="any" required="true">146 <cfargument name=" Timeout" type="any" required="false" default="" hint="Timeout in minutes. If timeout = 0 then object never times out. If timeout is blank, then timeout will be inherited from framework.">147 <cfargument name=" LastAccessTimeout" type="any" required="false" default="" hint="Timeout in minutes. If timeout is blank, then timeout will be inherited from framework.">148 <!--- ************************************************************* ---> 149 <cfscript> 150 var MetaData = structnew();144 <cfargument name="objectKey" type="any" required="true" hint="The object key"> 145 <cfargument name="object" type="any" required="true" hint="The object to save"> 146 <cfargument name="timeout" type="any" required="false" default="" hint="Timeout in minutes. If timeout = 0 then object never times out. If timeout is blank, then timeout will be inherited from framework."> 147 <cfargument name="lastAccessTimeout" type="any" required="false" default="" hint="Timeout in minutes. If timeout is blank, then timeout will be inherited from framework."> 148 <!--- ************************************************************* ---> 149 <cfscript> 150 var metaData = structnew(); 151 151 var targetObj = 0; 152 152 … … 154 154 if( arguments.timeout neq 0 ){ 155 155 /* Cache as soft reference not an eternal object */ 156 targetObj = createSoftReference(arguments.objectKey,arguments. MyObject);157 } 158 else{ 159 targetObj = arguments. MyObject;156 targetObj = createSoftReference(arguments.objectKey,arguments.object); 157 } 158 else{ 159 targetObj = arguments.object; 160 160 } 161 161 … … 164 164 165 165 /* Create object's metdata */ 166 MetaData.hits = 1;167 MetaData.Timeout = arguments.timeout;168 MetaData.LastAccessTimeout = arguments.LastAccessTimeout;169 MetaData.Created = now();170 MetaData.LastAccesed = now();166 metaData.hits = 1; 167 metaData.Timeout = arguments.timeout; 168 metaData.LastAccessTimeout = arguments.LastAccessTimeout; 169 metaData.Created = now(); 170 metaData.LastAccesed = now(); 171 171 172 172 /* Save the metadata */ 173 setObjectMetaData(arguments.objectkey, MetaData);173 setObjectMetaData(arguments.objectkey,metaData); 174 174 </cfscript> 175 175 </cffunction> … … 181 181 <!--- ************************************************************* ---> 182 182 <cfscript> 183 var Results = false;183 var results = false; 184 184 var softRef = ""; 185 185 … … 193 193 194 194 /* Remove Normal Cache Entries */ 195 structDelete( getPool(),arguments.objectKey);196 structDelete( getpool_metadata(),arguments.objectKey);195 structDelete(instance.pool, arguments.objectKey); 196 structDelete(instance.pool_metadata, arguments.objectKey); 197 197 198 198 /* Removed */ 199 Results = true;199 results = true; 200 200 } 201 201 catch(Any e){ 202 202 //Nothing; 203 203 } 204 return Results;204 return results; 205 205 </cfscript> 206 206 </cffunction>
