Changeset 1280

Show
Ignore:
Timestamp:
01/28/08 17:15:53 (5 years ago)
Author:
lmajano
Message:

Autowire update for DIComplete method firing and also, some caching statistics

Location:
coldbox/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • coldbox/trunk/ApplicationTemplate/config/coldbox.xml.cfm

    r1271 r1280  
    140140        <Datasources /> 
    141141         
    142         <!--ColdBox Object Caching Settings Overrides the Framework-wide settings --> 
     142        <!--ColdBox Object Caching Settings Overrides the Framework-wide settings  
    143143        <Cache> 
    144144                <ObjectDefaultTimeout>45</ObjectDefaultTimeout> 
    145145                <ObjectDefaultLastAccessTimeout>15</ObjectDefaultLastAccessTimeout> 
    146146                <UseLastAccessTimeouts>true</UseLastAccessTimeouts> 
    147                 <ReapFrequency>3</ReapFrequency> 
     147                <ReapFrequency>1</ReapFrequency> 
    148148                <MaxObjects>100</MaxObjects> 
    149                 <FreeMemoryPercentageThreshold>5</FreeMemoryPercentageThreshold> 
    150                 <!-- LFU/LRU --> 
     149                <FreeMemoryPercentageThreshold>1</FreeMemoryPercentageThreshold> 
    151150                <EvictionPolicy>LFU</EvictionPolicy> 
    152151        </Cache> 
     152        --> 
    153153         
    154154        <!-- Interceptor Declarations  
  • coldbox/trunk/src/system/config/settings.xml

    r1277 r1280  
    4141        <Setting name="CacheMaxObjects" value="100"/> 
    4242        <!--ColdBox Cache Parameter: Free JVM Memory % Threshold (0=not used)--> 
    43         <Setting name="CacheFreeMemoryPercentageThreshold" value="10"/> 
     43        <Setting name="CacheFreeMemoryPercentageThreshold" value="1"/> 
    4444        <!--ColdBox Cache Parameter: Whether reaping with default last access timeouts --> 
    4545        <Setting name="CacheUseLastAccessTimeouts" value="true"/>  
  • coldbox/trunk/src/system/interceptors/autowire.cfc

    r1267 r1280  
    3232                        else{ 
    3333                                setDebugMode(getProperty("debugMode")); 
     34                        } 
     35                        /* DI Complete Method */ 
     36                        if(propertyExists("completeDIMethodName")){ 
     37                                setCompleteDIMethodName(getProperty("completeDIMethodName")); 
     38                        } 
     39                        else{ 
     40                                setCompleteDIMethodName('onDIComplete'); 
    3441                        } 
    3542                </cfscript> 
     
    174181                                         
    175182                                }//end for loop of dependencies. 
     183                                 
     184                                /* Process After ID Complete */ 
     185                                processAfterCompleteDI(targetObject); 
     186                                 
    176187                        }//if autowiring                         
    177188                </cfscript> 
     
    227238        </cffunction> 
    228239         
     240        <!--- Process After DI Complete ---> 
     241        <cffunction name="processAfterCompleteDI" hint="see if we have a method to call after DI, and if so, call it" access="private" returntype="void" output="false"> 
     242                <!--- ************************************************************* ---> 
     243                <cfargument name="targetObject" hint="the target object to call on" type="any" required="Yes"> 
     244                <!--- ************************************************************* ---> 
     245                <cfset var meta = 0 /> 
     246                <cfif StructKeyExists(arguments.targetObject, getCompleteDIMethodName())> 
     247                        <cfset meta = getMetaData(arguments.targetObject[getCompleteDIMethodName()]) /> 
     248                        <cfif NOT StructKeyExists(meta, "access") OR meta.access eq "public"> 
     249                                <cfinvoke component="#arguments.targetObject#" method="#getCompleteDIMethodName()#" /> 
     250                        </cfif> 
     251                </cfif> 
     252        </cffunction> 
     253         
    229254        <!--- Get a new MD cache entry structure ---> 
    230255        <cffunction name="getNewMDEntry" access="private" returntype="struct" hint="Get a new metadata entry structure" output="false" > 
     
    258283                <cfset instance.debugMode = arguments.debugMode/> 
    259284        </cffunction> 
     285         
     286        <!--- Method to be called after DI ---> 
     287        <cffunction name="getCompleteDIMethodName" access="private" returntype="string" output="false"> 
     288                <cfreturn instance.completeDIMethodName /> 
     289        </cffunction> 
     290        <cffunction name="setCompleteDIMethodName" access="private" returntype="void" output="false"> 
     291                <cfargument name="completeDIMethodName" type="string" required="true"> 
     292                <cfset instance.completeDIMethodName = arguments.completeDIMethodName /> 
     293        </cffunction> 
     294 
     295        <cffunction name="hasCompleteDIMethodName" hint="do we have a after complete DI method" access="private" returntype="boolean" output="false"> 
     296                <cfreturn StructKeyExists(instance, "completeDIMethodName") /> 
     297        </cffunction> 
    260298 
    261299</cfcomponent>