What's new with ColdBox 2.6.1

Introduction

Version 2.6.1 is a critical fix release with some nice goodies with it. To view the entire list of tickets in this release, please click here. There are not that many new features in this release but they are some goodies.

ColdBox SideBar

This is another developer tool that will make your ColdBox development much easier. The full guide can be found here

This nifty little toolbar lives in your application (development of course) and helps you do the following:

  • Reinit the framework
  • Open cache and profiler monitors
  • Dump vars
  • Clear the Cache
  • Clear Scopes
  • Clear the log files
  • Go in and out of debug mode
  • Search the docs
  • Search the forums
  • Skinnable via css
  • Add your own links via configuration (JSON)
  • much more coming soon.

New Core Interception Points

We have added two more core interception points to ColdBox

  • afterCacheElementExpired : Executes after an element has expired from the cache
  • onException : Executes when an exception occurs anywhere in the framework

Caching Enhancements

There have been some cool minor enhancements to the cache.

  • FIFO Eviction policy (First In First Out)
  • New method: setEvictionPolicy(policyObj), you can now override eviction policies with anything you want
  • New method: getObjectMetadata(objectKey), you can now get the caching metadata structure about a specifc object key.

New Interceptor Output Buffer

What this means is that an interceptor has the following methods that enable you to add content to an output buffer that will be flushed after the execution of the interception point. Why would I use this? Well, just look at the ColdBox SideBar. I can create output without affecting handlers, views, etc. Interceptors wrap themselves around an execution (AOP), so you can output content in an non-obtrusive and decoupled manner.

  • clearBuffer():void
  • appendToBuffer(string):void
  • getBufferString():string
  • getBufferObject():coldbox.system.util.RequestBuffer

The buffer is unique per interception point but available to the entire chain of execution within an interception point. Once the interception point is executed, the interceptor service will check to see if the output buffer has content, if it does it will advice to write the output to the output stream. This way, you can produce output very cleanly from your interception points, without adding any messy-encapsulation breaking output=true tags to your interceptors. (BAD PRACTICE). This is an elegant solution that can work for both core and custom interception points.

<!--- Pre Render Execution --->
<cffunction name="preRender" access="public" returntype="boolean" hint="Executes before the framework starts the rendering cycle." output="false" >
        <cfargument name="event" required="true" type="any" hint="The event object : coldbox.system.beans.requestContext">
        <cfargument name="interceptData"        required="true" type="struct" hint="A structure containing intercepted information. NONE BY DEFAULT HERE">
        <cfscript>
        //clear all of it first
        clearBuffer();
        //Append to buffer
        appendToBuffer('This software is copyright by Luis Majano');    
        </cfscript>     
</cffunction>
Important: Each execution point will have its own clean buffer to work with. As each interception point has finalized execution, the output buffer is flushed, only if content exists.

Bean Factory Plugin Autowire Update

The Autowire method in the bean factory now has a stopRecursion argument that can be used to send in a class name where recursion should stop.