Changeset 1500

Show
Ignore:
Timestamp:
05/05/08 23:18:59 (5 years ago)
Author:
lmajano
Message:

ioc caching optimization
controller documentation updates
logger Ticket #436 eliminated appending extra "/"
Unit test updates

Location:
coldbox/trunk
Files:
1 added
5 modified

Legend:

Unmodified
Added
Removed
  • coldbox/trunk/src/system/controller.cfc

    r1494 r1500  
    3131                        //Set the Application hash on creation 
    3232                        setAppHash( hash(arguments.AppRootPath) ); 
     33                        //App Root 
    3334                        setAppRootPath(arguments.AppRootPath); 
    3435                         
     
    5758         
    5859        <!--- AppRootPath ---> 
    59         <cffunction name="getAppRootPath" access="public" returntype="string" output="false"> 
     60        <cffunction name="getAppRootPath" access="public" returntype="string" output="false" hint="Get this application's physical path"> 
    6061                <cfreturn instance.AppRootPath> 
    6162        </cffunction> 
    62         <cffunction name="setAppRootPath" access="public" returntype="void" output="false"> 
     63        <cffunction name="setAppRootPath" access="public" returntype="void" output="false" hint="Set this application's physical path."> 
    6364                <cfargument name="AppRootPath" type="string" required="true"> 
    6465                <cfset instance.AppRootPath = arguments.AppRootPath> 
  • coldbox/trunk/src/system/plugins/XMLParser.cfc

    r1475 r1500  
    183183                        //Schema Path 
    184184                        StructInsert(settingsStruct, "ConfigFileSchemaLocation", instance.FrameworkConfigXSDFile); 
    185                         //Application Path 
     185                        //Fix Application Path to last / standard. 
     186                        if( right(controller.getAppRootPath(),1) neq  instance.FileSeparator){ 
     187                                controller.setAppRootPath( controller.getAppRootPath() & instance.FileSeparator ); 
     188                        } 
     189                        //Now set the correct path. 
    186190                        StructInsert(settingsStruct, "ApplicationPath", controller.getAppRootPath() ); 
     191                         
    187192                        //Load Framework Path too 
    188193                        StructInsert(settingsStruct, "FrameworkPath", ExpandPath("/coldbox/system") & instance.FileSeparator ); 
  • coldbox/trunk/src/system/plugins/ioc.cfc

    r1471 r1500  
    113113                <cfset var beanKey = "ioc_" & arguments.beanName> 
    114114                <cfset var MetaData = structNew()> 
    115                 <cfset var objTimeout = ""> 
    116115                <cfset var objCaching = getSetting("IOCObjectCaching")> 
    117116 
     
    130129                        <!--- If Caching on, then set object in cache ---> 
    131130                        <cfif objCaching> 
    132                                 <cflock name="ioc.objectCaching.#arguments.beanName#" type="exclusive" timeout="30" throwontimeout="true"> 
    133                                         <!--- Get Object's MetaData, For Caching ---> 
    134                                         <cfset MetaData = getMetaData(oBean)> 
    135                                         <!--- By Default, services with no cache flag are set to false ---> 
    136                                         <cfif not structKeyExists(MetaData,"cache") or not isBoolean(MetaData.cache)> 
    137                                                 <cfset MetaData.cache = false> 
     131                                 
     132                                <!--- Get Object's MetaData, For Caching ---> 
     133                                <cfset MetaData = getMetaData(oBean)> 
     134                                <!--- By Default, services with no cache flag are set to false ---> 
     135                                <cfif not structKeyExists(MetaData,"cache") or not isBoolean(MetaData.cache)> 
     136                                        <cfset MetaData.cache = false> 
     137                                </cfif> 
     138                                 
     139                                <!--- Test for caching parameters ---> 
     140                                <cfif MetaData["cache"]> 
     141                                        <!--- Cache Metadata ---> 
     142                                        <cfif not structKeyExists(MetaData,"cachetimeout") or not isNumeric(metadata.cacheTimeout) > 
     143                                                <cfset MetaData.cacheTimeout = ""> 
    138144                                        </cfif> 
    139                                         <!--- Test for caching parameters ---> 
    140                                         <cfif MetaData["cache"]> 
    141                                                 <cfif structKeyExists(MetaData,"cachetimeout") > 
    142                                                         <cfset objTimeout = MetaData["cachetimeout"]> 
    143                                                 </cfif> 
     145                                        <cfif not structKeyExists(MetaData,"cacheLastAccessTimeout") or not isNumeric(metadata.cacheLastAccessTimeout) > 
     146                                                <cfset MetaData.cacheLastAccessTimeout = ""> 
     147                                        </cfif> 
     148                                         
     149                                        <cflock name="ioc.objectCaching.#arguments.beanName#" type="exclusive" timeout="30" throwontimeout="true"> 
    144150                                                <!--- Cache the object ---> 
    145                                                 <cfset getColdboxOCM().set(beanKey,oBean,objTimeout)> 
    146                                         </cfif> 
    147                                 </cflock> 
     151                                                <cfset getColdboxOCM().set(beanKey,oBean,metadata.cacheTimeout,metadata.cacheLastAccessTimeout)> 
     152                                        </cflock> 
     153                                </cfif> 
    148154                        </cfif> 
    149155                         
  • coldbox/trunk/src/system/plugins/logger.cfc

    r1471 r1500  
    371371        <cffunction name="setupLogLocationVariables" access="private" hint="Setup the log location variables." output="false" returntype="void"> 
    372372                <!--- The Default Full log directory path ---> 
    373                 <cfset var DefaultLogDirectory = getSetting("ApplicationPath",1) & getSetting("OSFileSeparator",1) & getSetting("DefaultLogDirectory",1)> 
     373                <cfset var DefaultLogDirectory = getSetting("ApplicationPath",1) & getSetting("DefaultLogDirectory",1)> 
    374374                <!--- The absolute test Path ---> 
    375375                <cfset var absTestPath = getPlugin("Utilities").getAbsolutePath(getSetting("ColdboxLogsLocation"))> 
    376376                <!--- The local relative test path ---> 
    377                 <cfset var TestPath = getSetting("ApplicationPath",1) & getSetting("OSFileSeparator",1) & getSetting("ColdboxLogsLocation")> 
     377                <cfset var TestPath = getSetting("ApplicationPath",1) & getSetting("ColdboxLogsLocation")> 
    378378                <!--- Test EstablishedLogLocationpath ---> 
    379379                <cfset var EstablishedLogLocationpath = ""> 
     
    394394                </cfif> 
    395395                 
     396                <!--- Fix Log Location for last /\---> 
     397                <cfif right(EstablishedLogLocationpath,1) neq getSetting("OSFileSeparator",1)> 
     398                        <cfset EstablishedLogLocationpath = EstablishedLogLocationpath & getSetting("OSFileSeparator",1)> 
     399                </cfif> 
     400                 
    396401                <!--- Finalize the path ---> 
    397                 <cfset EstablishedLogLocationpath = EstablishedLogLocationpath & getSetting("OSFileSeparator",1) & getLogFileName() & ".log"> 
     402                <cfset EstablishedLogLocationpath = EstablishedLogLocationpath & getLogFileName() & ".log"> 
    398403                 
    399404                <!--- Then set the complete log path and save. ---> 
  • coldbox/trunk/testing/testmodel/security.cfc

    r1396 r1500  
    1 <cfcomponent output="false">  
     1<cfcomponent output="false" cache="true" cachetimeout="5" cacheLastAccessTimeout="1">  
    22 
    33        <cffunction name="init" access="public" returntype="security" hint="" output="false" >