Changeset 1592

Show
Ignore:
Timestamp:
07/01/08 00:36:29 (3 months ago)
Author:
lmajano
Message:

Finalized proxy and normal monitors and tracers.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • coldbox/trunk/system/coldbox.cfc

    r1578 r1592  
    211211                        </cftry> 
    212212                         
    213                         <!--- Request Profilers ---> 
    214                         <cfif cbController.getDebuggerService().getDebuggerConfigBean().getPersistentRequestProfiler() and 
    215                                   structKeyExists(request,"debugTimers")> 
    216                                 <cfset cbController.getDebuggerService().pushProfiler(request.DebugTimers)> 
    217                         </cfif> 
    218                          
    219213                        <!--- DebugMode Routines ---> 
    220214                        <cfif cbController.getDebuggerService().getDebugMode()> 
     215                                <!--- Request Profilers ---> 
     216                                <cfif cbController.getDebuggerService().getDebuggerConfigBean().getPersistentRequestProfiler() and 
     217                                          structKeyExists(request,"debugTimers")> 
     218                                        <cfset cbController.getDebuggerService().pushProfiler(request.DebugTimers)> 
     219                                </cfif> 
    221220                                <!--- Render DebugPanel ---> 
    222221                                <cfif Event.getdebugpanelFlag()> 
  • coldbox/trunk/system/extras/ColdboxProxy.cfc

    r1575 r1592  
    2828                         
    2929                        try{ 
    30                                 //Create the request context 
     30                                /* Trace the incoming arguments. */ 
     31                                tracer('Process: Incoming arguments',arguments); 
     32                                 
     33                                /* Create the request context */ 
    3134                                Event = cbController.getRequestService().requestCapture(); 
    3235                                 
     
    6770                        } 
    6871                        catch(Any e){ 
    69                                 //Log Exception 
     72                                /* Log Exception */ 
    7073                                cbController.getExceptionService().ExceptionHandler(e,"coldboxproxy","Process Exception"); 
     74                                 
    7175                                /* Verify stacktrace */ 
    7276                                if( not structKeyExists(e,"stacktrace") ){ 
    7377                                        e.stacktrace = ""; 
    7478                                } 
     79                                 
    7580                                /* Request Profilers */ 
    76                                 pushTimers(cbController); 
    77                          
     81                                pushTimers(); 
    7882                                /* Custom throw. */ 
    7983                                throwit(e.message.toString(),e.detail.toString() & e.stacktrace.toString()); 
     
    8185                         
    8286                        /* Request Profilers */ 
    83                         pushTimers(cbController); 
    84                                  
    85                         //Determine what to return via the setting 
     87                        pushTimers(); 
     88                                 
     89                        /* Determine what to return via the setting */ 
    8690                        if ( cbController.getSetting("ProxyReturnCollection") ){ 
    87                                 //Return request collection 
     91                                /* Return request collection */ 
    8892                                return Event.getCollection(); 
    8993                        } 
     
    9195                                /* Check for Marshalling */ 
    9296                                if ( not structisEmpty(Event.getRenderData()) ){ 
    93                                         return getPlugin("Utilities").marshallData(argumentCollection=Event.getRenderData()); 
    94                                 } 
    95                                 //Return results from handler only if found, else method will produce a null result 
     97                                        local.results = getPlugin("Utilities").marshallData(argumentCollection=Event.getRenderData()); 
     98                                } 
     99                                /* Return results from handler only if found, else method will produce a null result */ 
    96100                                if( structKeyExists(local,"results") ){ 
     101                                        /* Trace the results */ 
     102                                        tracer('Process: Outgoing Results',local.results); 
     103                                        /* Return The results */ 
    97104                                        return local.results; 
    98105                                } 
     106                                else{ 
     107                                        /* Trace the results */ 
     108                                        tracer('No outgoing results found in the local scope.'); 
     109                                }                                
    99110                        } 
    100111                </cfscript>              
     
    117128                        interceptionStructure.interceptData = arguments.interceptData; 
    118129                         
    119                         //Intercept 
     130                        /* Trace the incoming arguments */ 
     131                        tracer('AnnounceInterception: incoming arguments',arguments); 
     132                                         
     133                        /* Intercept */ 
    120134                        try{ 
    121135                                cbController.getInterceptorService().processState(arguments.state,interceptionStructure); 
     
    125139                                cbController.getExceptionService().ExceptionHandler(e,"coldboxproxy","Interception Exception"); 
    126140                                /* Request Profilers */ 
    127                                 pushTimers(cbController); 
     141                                pushTimers(); 
    128142                                /* Return */ 
    129143                                return false; 
     
    131145                         
    132146                        /* Request Profilers */ 
    133                         pushTimers(cbController); 
     147                        pushTimers(); 
    134148                         
    135149                        /* Return */ 
     
    140154<!------------------------------------------- PRIVATE ------------------------------------------->       
    141155         
     156        <!--- Trace messages to the tracer panel ---> 
     157        <cffunction name="tracer" access="private" returntype="void" hint="Trace messages to the tracer panel, will only trace if in debug mode." output="false" > 
     158                <!--- ************************************************************* ---> 
     159                <cfargument name="message"    type="string" required="Yes" hint="Message to Send" > 
     160                <cfargument name="ExtraInfo"  required="No" default="" type="any" hint="Extra Information to dump on the trace"> 
     161                <!--- ************************************************************* ---> 
     162                <cfscript> 
     163                        var cbController = getController(); 
     164                         
     165                        if( cbController.getDebuggerService().getDebugMode() ){ 
     166                                cbController.getPlugin("logger").tracer(argumentCollection=arguments); 
     167                        } 
     168                </cfscript> 
     169        </cffunction> 
     170         
    142171        <!--- Push Timers ---> 
    143172        <cffunction name="pushTimers" access="private" returntype="void" hint="Push timers into debugging stack" output="false" > 
    144                 <cfargument name="cbController" required="true" type="any" hint="the coldbox controller"> 
    145                 <cfscript> 
    146                         var dService = arguments.cbController.getDebuggerService(); 
    147                          
    148                         /* Request Profilers */ 
    149                         if ( dService.getDebuggerConfigBean().getPersistentRequestProfiler() and 
    150                                  structKeyExists(request,"debugTimers") ){ 
    151                                 /* Push timers */ 
    152                                 dService.pushProfiler(request.DebugTimers); 
     173                <cfscript> 
     174                        var cbController = getController(); 
     175                        var dService = cbController.getDebuggerService(); 
     176                         
     177                        /* Only push if in debug mode. */ 
     178                        if( cbController.getDebuggerService().getDebugMode() ){ 
     179                                /* Request Profilers */ 
     180                                if ( dService.getDebuggerConfigBean().getPersistentRequestProfiler() and structKeyExists(request,"debugTimers") ){ 
     181                                        /* Push timers */ 
     182                                        dService.pushProfiler(request.DebugTimers); 
     183                                } 
    153184                        } 
    154185                </cfscript> 

Copyright 2006 ColdBox Framework by Luis Majano