Changeset 2354

Show
Ignore:
Timestamp:
06/26/09 03:43:38 (4 years ago)
Author:
lmajano
Message:

syntax fixes and notation

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • coldbox/trunk/system/cache/ObjectPool.cfc

    r1976 r2354  
    142142        <cffunction name="set" access="public" output="false" returntype="void" hint="sets an object in cache."> 
    143143                <!--- ************************************************************* ---> 
    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(); 
    151151                        var targetObj = 0; 
    152152                         
     
    154154                        if( arguments.timeout neq 0 ){ 
    155155                                /* 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; 
    160160                        } 
    161161                         
     
    164164                         
    165165                        /* 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();                    
    171171                         
    172172                        /* Save the metadata */ 
    173                         setObjectMetaData(arguments.objectkey,MetaData); 
     173                        setObjectMetaData(arguments.objectkey,metaData); 
    174174                </cfscript> 
    175175        </cffunction> 
     
    181181                <!--- ************************************************************* ---> 
    182182                <cfscript> 
    183                         var Results = false; 
     183                        var results = false; 
    184184                        var softRef = ""; 
    185185                         
     
    193193                                 
    194194                                /* 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); 
    197197                                                                 
    198198                                /* Removed */ 
    199                                 Results = true; 
     199                                results = true; 
    200200                        } 
    201201                        catch(Any e){ 
    202202                                //Nothing; 
    203203                        } 
    204                         return Results; 
     204                        return results; 
    205205                </cfscript> 
    206206        </cffunction>